{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Wind Statistics"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Introduction:\n",
    "\n",
    "The data have been modified to contain some missing values, identified by NaN.  \n",
    "Using pandas should make this exercise\n",
    "easier, in particular for the bonus question.\n",
    "\n",
    "You should be able to perform all of these operations without using\n",
    "a for loop or other looping construct.\n",
    "\n",
    "\n",
    "1. The data in 'wind.data' has the following format:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'\\nYr Mo Dy   RPT   VAL   ROS   KIL   SHA   BIR   DUB   CLA   MUL   CLO   BEL   MAL\\n61  1  1 15.04 14.96 13.17  9.29   NaN  9.87 13.67 10.25 10.83 12.58 18.50 15.04\\n61  1  2 14.71   NaN 10.83  6.50 12.62  7.67 11.50 10.04  9.79  9.67 17.54 13.83\\n61  1  3 18.50 16.88 12.33 10.13 11.17  6.17 11.25   NaN  8.50  7.67 12.75 12.71\\n'"
      ]
     },
     "execution_count": 1,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "\"\"\"\n",
    "Yr Mo Dy   RPT   VAL   ROS   KIL   SHA   BIR   DUB   CLA   MUL   CLO   BEL   MAL\n",
    "61  1  1 15.04 14.96 13.17  9.29   NaN  9.87 13.67 10.25 10.83 12.58 18.50 15.04\n",
    "61  1  2 14.71   NaN 10.83  6.50 12.62  7.67 11.50 10.04  9.79  9.67 17.54 13.83\n",
    "61  1  3 18.50 16.88 12.33 10.13 11.17  6.17 11.25   NaN  8.50  7.67 12.75 12.71\n",
    "\"\"\""
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "   The first three columns are year, month and day.  The\n",
    "   remaining 12 columns are average windspeeds in knots at 12\n",
    "   locations in Ireland on that day.   \n",
    "\n",
    "   More information about the dataset go [here](wind.desc)."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "collapsed": false
   },
   "source": [
    "### Step 1. Import the necessary libraries"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "import pandas as pd\n",
    "import datetime"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Step 2. Import the dataset from this [address](https://github.com/guipsamora/pandas_exercises/blob/master/Stats/Wind_Stats/wind.data)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Step 3. Assign it to a variable called data and replace the first 3 columns by a proper datetime index."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 414,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Yr_Mo_Dy</th>\n",
       "      <th>RPT</th>\n",
       "      <th>VAL</th>\n",
       "      <th>ROS</th>\n",
       "      <th>KIL</th>\n",
       "      <th>SHA</th>\n",
       "      <th>BIR</th>\n",
       "      <th>DUB</th>\n",
       "      <th>CLA</th>\n",
       "      <th>MUL</th>\n",
       "      <th>CLO</th>\n",
       "      <th>BEL</th>\n",
       "      <th>MAL</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>2061-01-01</td>\n",
       "      <td>15.04</td>\n",
       "      <td>14.96</td>\n",
       "      <td>13.17</td>\n",
       "      <td>9.29</td>\n",
       "      <td>NaN</td>\n",
       "      <td>9.87</td>\n",
       "      <td>13.67</td>\n",
       "      <td>10.25</td>\n",
       "      <td>10.83</td>\n",
       "      <td>12.58</td>\n",
       "      <td>18.50</td>\n",
       "      <td>15.04</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>2061-01-02</td>\n",
       "      <td>14.71</td>\n",
       "      <td>NaN</td>\n",
       "      <td>10.83</td>\n",
       "      <td>6.50</td>\n",
       "      <td>12.62</td>\n",
       "      <td>7.67</td>\n",
       "      <td>11.50</td>\n",
       "      <td>10.04</td>\n",
       "      <td>9.79</td>\n",
       "      <td>9.67</td>\n",
       "      <td>17.54</td>\n",
       "      <td>13.83</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>2061-01-03</td>\n",
       "      <td>18.50</td>\n",
       "      <td>16.88</td>\n",
       "      <td>12.33</td>\n",
       "      <td>10.13</td>\n",
       "      <td>11.17</td>\n",
       "      <td>6.17</td>\n",
       "      <td>11.25</td>\n",
       "      <td>NaN</td>\n",
       "      <td>8.50</td>\n",
       "      <td>7.67</td>\n",
       "      <td>12.75</td>\n",
       "      <td>12.71</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>2061-01-04</td>\n",
       "      <td>10.58</td>\n",
       "      <td>6.63</td>\n",
       "      <td>11.75</td>\n",
       "      <td>4.58</td>\n",
       "      <td>4.54</td>\n",
       "      <td>2.88</td>\n",
       "      <td>8.63</td>\n",
       "      <td>1.79</td>\n",
       "      <td>5.83</td>\n",
       "      <td>5.88</td>\n",
       "      <td>5.46</td>\n",
       "      <td>10.88</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>2061-01-05</td>\n",
       "      <td>13.33</td>\n",
       "      <td>13.25</td>\n",
       "      <td>11.42</td>\n",
       "      <td>6.17</td>\n",
       "      <td>10.71</td>\n",
       "      <td>8.21</td>\n",
       "      <td>11.92</td>\n",
       "      <td>6.54</td>\n",
       "      <td>10.92</td>\n",
       "      <td>10.34</td>\n",
       "      <td>12.92</td>\n",
       "      <td>11.83</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "    Yr_Mo_Dy    RPT    VAL    ROS    KIL    SHA   BIR    DUB    CLA    MUL  \\\n",
       "0 2061-01-01  15.04  14.96  13.17   9.29    NaN  9.87  13.67  10.25  10.83   \n",
       "1 2061-01-02  14.71    NaN  10.83   6.50  12.62  7.67  11.50  10.04   9.79   \n",
       "2 2061-01-03  18.50  16.88  12.33  10.13  11.17  6.17  11.25    NaN   8.50   \n",
       "3 2061-01-04  10.58   6.63  11.75   4.58   4.54  2.88   8.63   1.79   5.83   \n",
       "4 2061-01-05  13.33  13.25  11.42   6.17  10.71  8.21  11.92   6.54  10.92   \n",
       "\n",
       "     CLO    BEL    MAL  \n",
       "0  12.58  18.50  15.04  \n",
       "1   9.67  17.54  13.83  \n",
       "2   7.67  12.75  12.71  \n",
       "3   5.88   5.46  10.88  \n",
       "4  10.34  12.92  11.83  "
      ]
     },
     "execution_count": 414,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# parse_dates gets 0, 1, 2 columns and parses them as the index\n",
    "data = pd.read_table(\"wind.data\", sep = \"\\s+\", parse_dates = [[0,1,2]]) \n",
    "data.head()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Step 4. Year 2061? Do we really have data from this year? Create a function to fix it and apply it."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 415,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Yr_Mo_Dy</th>\n",
       "      <th>RPT</th>\n",
       "      <th>VAL</th>\n",
       "      <th>ROS</th>\n",
       "      <th>KIL</th>\n",
       "      <th>SHA</th>\n",
       "      <th>BIR</th>\n",
       "      <th>DUB</th>\n",
       "      <th>CLA</th>\n",
       "      <th>MUL</th>\n",
       "      <th>CLO</th>\n",
       "      <th>BEL</th>\n",
       "      <th>MAL</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1961-01-01</td>\n",
       "      <td>15.04</td>\n",
       "      <td>14.96</td>\n",
       "      <td>13.17</td>\n",
       "      <td>9.29</td>\n",
       "      <td>NaN</td>\n",
       "      <td>9.87</td>\n",
       "      <td>13.67</td>\n",
       "      <td>10.25</td>\n",
       "      <td>10.83</td>\n",
       "      <td>12.58</td>\n",
       "      <td>18.50</td>\n",
       "      <td>15.04</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>1961-01-02</td>\n",
       "      <td>14.71</td>\n",
       "      <td>NaN</td>\n",
       "      <td>10.83</td>\n",
       "      <td>6.50</td>\n",
       "      <td>12.62</td>\n",
       "      <td>7.67</td>\n",
       "      <td>11.50</td>\n",
       "      <td>10.04</td>\n",
       "      <td>9.79</td>\n",
       "      <td>9.67</td>\n",
       "      <td>17.54</td>\n",
       "      <td>13.83</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>1961-01-03</td>\n",
       "      <td>18.50</td>\n",
       "      <td>16.88</td>\n",
       "      <td>12.33</td>\n",
       "      <td>10.13</td>\n",
       "      <td>11.17</td>\n",
       "      <td>6.17</td>\n",
       "      <td>11.25</td>\n",
       "      <td>NaN</td>\n",
       "      <td>8.50</td>\n",
       "      <td>7.67</td>\n",
       "      <td>12.75</td>\n",
       "      <td>12.71</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>1961-01-04</td>\n",
       "      <td>10.58</td>\n",
       "      <td>6.63</td>\n",
       "      <td>11.75</td>\n",
       "      <td>4.58</td>\n",
       "      <td>4.54</td>\n",
       "      <td>2.88</td>\n",
       "      <td>8.63</td>\n",
       "      <td>1.79</td>\n",
       "      <td>5.83</td>\n",
       "      <td>5.88</td>\n",
       "      <td>5.46</td>\n",
       "      <td>10.88</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>1961-01-05</td>\n",
       "      <td>13.33</td>\n",
       "      <td>13.25</td>\n",
       "      <td>11.42</td>\n",
       "      <td>6.17</td>\n",
       "      <td>10.71</td>\n",
       "      <td>8.21</td>\n",
       "      <td>11.92</td>\n",
       "      <td>6.54</td>\n",
       "      <td>10.92</td>\n",
       "      <td>10.34</td>\n",
       "      <td>12.92</td>\n",
       "      <td>11.83</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "     Yr_Mo_Dy    RPT    VAL    ROS    KIL    SHA   BIR    DUB    CLA    MUL  \\\n",
       "0  1961-01-01  15.04  14.96  13.17   9.29    NaN  9.87  13.67  10.25  10.83   \n",
       "1  1961-01-02  14.71    NaN  10.83   6.50  12.62  7.67  11.50  10.04   9.79   \n",
       "2  1961-01-03  18.50  16.88  12.33  10.13  11.17  6.17  11.25    NaN   8.50   \n",
       "3  1961-01-04  10.58   6.63  11.75   4.58   4.54  2.88   8.63   1.79   5.83   \n",
       "4  1961-01-05  13.33  13.25  11.42   6.17  10.71  8.21  11.92   6.54  10.92   \n",
       "\n",
       "     CLO    BEL    MAL  \n",
       "0  12.58  18.50  15.04  \n",
       "1   9.67  17.54  13.83  \n",
       "2   7.67  12.75  12.71  \n",
       "3   5.88   5.46  10.88  \n",
       "4  10.34  12.92  11.83  "
      ]
     },
     "execution_count": 415,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# The problem is that the dates are 2061 and so on...\n",
    "\n",
    "# function that uses datetime\n",
    "def fix_century(x):\n",
    "  year = x.year - 100 if x.year > 1989 else x.year\n",
    "  return datetime.date(year, x.month, x.day)\n",
    "\n",
    "# apply the function fix_century on the column and replace the values to the right ones\n",
    "data['Yr_Mo_Dy'] = data['Yr_Mo_Dy'].apply(fix_century)\n",
    "\n",
    "# data.info()\n",
    "data.head()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Step 5. Set the right dates as the index. Pay attention at the data type, it should be datetime64[ns]."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "ename": "NameError",
     "evalue": "name 'pd' is not defined",
     "output_type": "error",
     "traceback": [
      "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[0;31mNameError\u001b[0m                                 Traceback (most recent call last)",
      "\u001b[0;32m<ipython-input-1-a16826161a02>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m()\u001b[0m\n\u001b[1;32m      1\u001b[0m \u001b[0;31m# transform Yr_Mo_Dy it to date type datetime64\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m----> 2\u001b[0;31m \u001b[0mdata\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;34m\"Yr_Mo_Dy\"\u001b[0m\u001b[0;34m]\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mpd\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mto_datetime\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mdata\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;34m\"Yr_Mo_Dy\"\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m      3\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m      4\u001b[0m \u001b[0;31m# set 'Yr_Mo_Dy' as the index\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m      5\u001b[0m \u001b[0mdata\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mdata\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mset_index\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m'Yr_Mo_Dy'\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
      "\u001b[0;31mNameError\u001b[0m: name 'pd' is not defined"
     ]
    }
   ],
   "source": [
    "# transform Yr_Mo_Dy it to date type datetime64\n",
    "data[\"Yr_Mo_Dy\"] = pd.to_datetime(data[\"Yr_Mo_Dy\"])\n",
    "\n",
    "# set 'Yr_Mo_Dy' as the index\n",
    "data = data.set_index('Yr_Mo_Dy')\n",
    "\n",
    "data.head()\n",
    "# data.info()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Step 6. Compute how many values are missing for each location over the entire record.  \n",
    "#### They should be ignored in all calculations below. "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 423,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "RPT    6\n",
       "VAL    3\n",
       "ROS    2\n",
       "KIL    5\n",
       "SHA    2\n",
       "BIR    0\n",
       "DUB    3\n",
       "CLA    2\n",
       "MUL    3\n",
       "CLO    1\n",
       "BEL    0\n",
       "MAL    4\n",
       "dtype: int64"
      ]
     },
     "execution_count": 423,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# \"Number of non-missing values for each location: \"\n",
    "data.isnull().sum()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Step 7. Compute how many non-missing values there are in total."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 424,
   "metadata": {
    "collapsed": false,
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "RPT     6\n",
       "VAL     9\n",
       "ROS    10\n",
       "KIL     7\n",
       "SHA    10\n",
       "BIR    12\n",
       "DUB     9\n",
       "CLA    10\n",
       "MUL     9\n",
       "CLO    11\n",
       "BEL    12\n",
       "MAL     8\n",
       "dtype: int64"
      ]
     },
     "execution_count": 424,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# number of columns minus the number of missing values for each location\n",
    "data.shape[1] - data.isnull().sum()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Step 8. Calculate the mean windspeeds of the windspeeds over all the locations and all the times.\n",
    "#### A single number for the entire dataset."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 426,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "10.227982360836924"
      ]
     },
     "execution_count": 426,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# print 'Mean over all values is: '\n",
    "data.mean().mean()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Step 9. Create a DataFrame called loc_stats and calculate the min, max and mean windspeeds and standard deviations of the windspeeds at each location over all the days \n",
    "\n",
    "#### A different set of numbers for each location."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 264,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>min</th>\n",
       "      <th>max</th>\n",
       "      <th>mean</th>\n",
       "      <th>std</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>RPT</th>\n",
       "      <td>0.67</td>\n",
       "      <td>35.80</td>\n",
       "      <td>12.362987</td>\n",
       "      <td>5.618413</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>VAL</th>\n",
       "      <td>0.21</td>\n",
       "      <td>33.37</td>\n",
       "      <td>10.644314</td>\n",
       "      <td>5.267356</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>ROS</th>\n",
       "      <td>1.50</td>\n",
       "      <td>33.84</td>\n",
       "      <td>11.660526</td>\n",
       "      <td>5.008450</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>KIL</th>\n",
       "      <td>0.00</td>\n",
       "      <td>28.46</td>\n",
       "      <td>6.306468</td>\n",
       "      <td>3.605811</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>SHA</th>\n",
       "      <td>0.13</td>\n",
       "      <td>37.54</td>\n",
       "      <td>10.455834</td>\n",
       "      <td>4.936125</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>BIR</th>\n",
       "      <td>0.00</td>\n",
       "      <td>26.16</td>\n",
       "      <td>7.092254</td>\n",
       "      <td>3.968683</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>DUB</th>\n",
       "      <td>0.00</td>\n",
       "      <td>30.37</td>\n",
       "      <td>9.797343</td>\n",
       "      <td>4.977555</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>CLA</th>\n",
       "      <td>0.00</td>\n",
       "      <td>31.08</td>\n",
       "      <td>8.495053</td>\n",
       "      <td>4.499449</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>MUL</th>\n",
       "      <td>0.00</td>\n",
       "      <td>25.88</td>\n",
       "      <td>8.493590</td>\n",
       "      <td>4.166872</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>CLO</th>\n",
       "      <td>0.04</td>\n",
       "      <td>28.21</td>\n",
       "      <td>8.707332</td>\n",
       "      <td>4.503954</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>BEL</th>\n",
       "      <td>0.13</td>\n",
       "      <td>42.38</td>\n",
       "      <td>13.121007</td>\n",
       "      <td>5.835037</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>MAL</th>\n",
       "      <td>0.67</td>\n",
       "      <td>42.54</td>\n",
       "      <td>15.599079</td>\n",
       "      <td>6.699794</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "      min    max       mean       std\n",
       "RPT  0.67  35.80  12.362987  5.618413\n",
       "VAL  0.21  33.37  10.644314  5.267356\n",
       "ROS  1.50  33.84  11.660526  5.008450\n",
       "KIL  0.00  28.46   6.306468  3.605811\n",
       "SHA  0.13  37.54  10.455834  4.936125\n",
       "BIR  0.00  26.16   7.092254  3.968683\n",
       "DUB  0.00  30.37   9.797343  4.977555\n",
       "CLA  0.00  31.08   8.495053  4.499449\n",
       "MUL  0.00  25.88   8.493590  4.166872\n",
       "CLO  0.04  28.21   8.707332  4.503954\n",
       "BEL  0.13  42.38  13.121007  5.835037\n",
       "MAL  0.67  42.54  15.599079  6.699794"
      ]
     },
     "execution_count": 264,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "loc_stats = pd.DataFrame()\n",
    "\n",
    "loc_stats['min'] = data.min() # min\n",
    "loc_stats['max'] = data.max() # max \n",
    "loc_stats['mean'] = data.mean() # mean\n",
    "loc_stats['std'] = data.std() # standard deviations\n",
    "\n",
    "loc_stats"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Step 10. Create a DataFrame called day_stats and calculate the min, max and mean windspeed and standard deviations of the windspeeds across all the locations at each day.\n",
    "\n",
    "#### A different set of numbers for each day."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 404,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>min</th>\n",
       "      <th>max</th>\n",
       "      <th>mean</th>\n",
       "      <th>std</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1.0</td>\n",
       "      <td>18.50</td>\n",
       "      <td>12.016667</td>\n",
       "      <td>4.382798</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>1.0</td>\n",
       "      <td>17.54</td>\n",
       "      <td>10.475000</td>\n",
       "      <td>4.260110</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>1.0</td>\n",
       "      <td>18.50</td>\n",
       "      <td>10.755000</td>\n",
       "      <td>4.664914</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>1.0</td>\n",
       "      <td>11.75</td>\n",
       "      <td>6.186923</td>\n",
       "      <td>3.435771</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>1.0</td>\n",
       "      <td>13.33</td>\n",
       "      <td>9.889231</td>\n",
       "      <td>3.551768</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   min    max       mean       std\n",
       "0  1.0  18.50  12.016667  4.382798\n",
       "1  1.0  17.54  10.475000  4.260110\n",
       "2  1.0  18.50  10.755000  4.664914\n",
       "3  1.0  11.75   6.186923  3.435771\n",
       "4  1.0  13.33   9.889231  3.551768"
      ]
     },
     "execution_count": 404,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# create the dataframe\n",
    "day_stats = pd.DataFrame()\n",
    "\n",
    "# this time we determine axis equals to one so it gets each row.\n",
    "day_stats['min'] = data.min(axis = 1) # min\n",
    "day_stats['max'] = data.max(axis = 1) # max \n",
    "day_stats['mean'] = data.mean(axis = 1) # mean\n",
    "day_stats['std'] = data.std(axis = 1) # standard deviations\n",
    "\n",
    "day_stats.head()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Step 11. Find the average windspeed in January for each location.  \n",
    "#### Treat January 1961 and January 1962 both as January."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 427,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "RPT    14.847325\n",
       "VAL    12.914560\n",
       "ROS    13.299624\n",
       "KIL     7.199498\n",
       "SHA    11.667734\n",
       "BIR     8.054839\n",
       "DUB    11.819355\n",
       "CLA     9.512047\n",
       "MUL     9.543208\n",
       "CLO    10.053566\n",
       "BEL    14.550520\n",
       "MAL    18.028763\n",
       "dtype: float64"
      ]
     },
     "execution_count": 427,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# print \"January windspeeds:\"\n",
    "\n",
    "# creates a new column 'date' and gets the values from the index\n",
    "data['date'] = data.index\n",
    "\n",
    "# creates a column for each value from date\n",
    "data['month'] = data['date'].apply(lambda date: date.month)\n",
    "data['year'] = data['date'].apply(lambda date: date.year)\n",
    "data['day'] = data['date'].apply(lambda date: date.day)\n",
    "\n",
    "# gets all value from the month 1 and assign to janyary_winds\n",
    "january_winds = data.query('month == 1')\n",
    "\n",
    "# gets the mean from january_winds, using .loc to not print the mean of month, year and day\n",
    "january_winds.loc[:,'RPT':\"MAL\"].mean()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Step 12. Downsample the record to a yearly frequency for each location."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 428,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>RPT</th>\n",
       "      <th>VAL</th>\n",
       "      <th>ROS</th>\n",
       "      <th>KIL</th>\n",
       "      <th>SHA</th>\n",
       "      <th>BIR</th>\n",
       "      <th>DUB</th>\n",
       "      <th>CLA</th>\n",
       "      <th>MUL</th>\n",
       "      <th>CLO</th>\n",
       "      <th>BEL</th>\n",
       "      <th>MAL</th>\n",
       "      <th>date</th>\n",
       "      <th>month</th>\n",
       "      <th>year</th>\n",
       "      <th>day</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Yr_Mo_Dy</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>1961-01-01</th>\n",
       "      <td>15.04</td>\n",
       "      <td>14.96</td>\n",
       "      <td>13.17</td>\n",
       "      <td>9.29</td>\n",
       "      <td>NaN</td>\n",
       "      <td>9.87</td>\n",
       "      <td>13.67</td>\n",
       "      <td>10.25</td>\n",
       "      <td>10.83</td>\n",
       "      <td>12.58</td>\n",
       "      <td>18.50</td>\n",
       "      <td>15.04</td>\n",
       "      <td>1961-01-01</td>\n",
       "      <td>1</td>\n",
       "      <td>1961</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1962-01-01</th>\n",
       "      <td>9.29</td>\n",
       "      <td>3.42</td>\n",
       "      <td>11.54</td>\n",
       "      <td>3.50</td>\n",
       "      <td>2.21</td>\n",
       "      <td>1.96</td>\n",
       "      <td>10.41</td>\n",
       "      <td>2.79</td>\n",
       "      <td>3.54</td>\n",
       "      <td>5.17</td>\n",
       "      <td>4.38</td>\n",
       "      <td>7.92</td>\n",
       "      <td>1962-01-01</td>\n",
       "      <td>1</td>\n",
       "      <td>1962</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1963-01-01</th>\n",
       "      <td>15.59</td>\n",
       "      <td>13.62</td>\n",
       "      <td>19.79</td>\n",
       "      <td>8.38</td>\n",
       "      <td>12.25</td>\n",
       "      <td>10.00</td>\n",
       "      <td>23.45</td>\n",
       "      <td>15.71</td>\n",
       "      <td>13.59</td>\n",
       "      <td>14.37</td>\n",
       "      <td>17.58</td>\n",
       "      <td>34.13</td>\n",
       "      <td>1963-01-01</td>\n",
       "      <td>1</td>\n",
       "      <td>1963</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1964-01-01</th>\n",
       "      <td>25.80</td>\n",
       "      <td>22.13</td>\n",
       "      <td>18.21</td>\n",
       "      <td>13.25</td>\n",
       "      <td>21.29</td>\n",
       "      <td>14.79</td>\n",
       "      <td>14.12</td>\n",
       "      <td>19.58</td>\n",
       "      <td>13.25</td>\n",
       "      <td>16.75</td>\n",
       "      <td>28.96</td>\n",
       "      <td>21.00</td>\n",
       "      <td>1964-01-01</td>\n",
       "      <td>1</td>\n",
       "      <td>1964</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1965-01-01</th>\n",
       "      <td>9.54</td>\n",
       "      <td>11.92</td>\n",
       "      <td>9.00</td>\n",
       "      <td>4.38</td>\n",
       "      <td>6.08</td>\n",
       "      <td>5.21</td>\n",
       "      <td>10.25</td>\n",
       "      <td>6.08</td>\n",
       "      <td>5.71</td>\n",
       "      <td>8.63</td>\n",
       "      <td>12.04</td>\n",
       "      <td>17.41</td>\n",
       "      <td>1965-01-01</td>\n",
       "      <td>1</td>\n",
       "      <td>1965</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1966-01-01</th>\n",
       "      <td>22.04</td>\n",
       "      <td>21.50</td>\n",
       "      <td>17.08</td>\n",
       "      <td>12.75</td>\n",
       "      <td>22.17</td>\n",
       "      <td>15.59</td>\n",
       "      <td>21.79</td>\n",
       "      <td>18.12</td>\n",
       "      <td>16.66</td>\n",
       "      <td>17.83</td>\n",
       "      <td>28.33</td>\n",
       "      <td>23.79</td>\n",
       "      <td>1966-01-01</td>\n",
       "      <td>1</td>\n",
       "      <td>1966</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1967-01-01</th>\n",
       "      <td>6.46</td>\n",
       "      <td>4.46</td>\n",
       "      <td>6.50</td>\n",
       "      <td>3.21</td>\n",
       "      <td>6.67</td>\n",
       "      <td>3.79</td>\n",
       "      <td>11.38</td>\n",
       "      <td>3.83</td>\n",
       "      <td>7.71</td>\n",
       "      <td>9.08</td>\n",
       "      <td>10.67</td>\n",
       "      <td>20.91</td>\n",
       "      <td>1967-01-01</td>\n",
       "      <td>1</td>\n",
       "      <td>1967</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1968-01-01</th>\n",
       "      <td>30.04</td>\n",
       "      <td>17.88</td>\n",
       "      <td>16.25</td>\n",
       "      <td>16.25</td>\n",
       "      <td>21.79</td>\n",
       "      <td>12.54</td>\n",
       "      <td>18.16</td>\n",
       "      <td>16.62</td>\n",
       "      <td>18.75</td>\n",
       "      <td>17.62</td>\n",
       "      <td>22.25</td>\n",
       "      <td>27.29</td>\n",
       "      <td>1968-01-01</td>\n",
       "      <td>1</td>\n",
       "      <td>1968</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1969-01-01</th>\n",
       "      <td>6.13</td>\n",
       "      <td>1.63</td>\n",
       "      <td>5.41</td>\n",
       "      <td>1.08</td>\n",
       "      <td>2.54</td>\n",
       "      <td>1.00</td>\n",
       "      <td>8.50</td>\n",
       "      <td>2.42</td>\n",
       "      <td>4.58</td>\n",
       "      <td>6.34</td>\n",
       "      <td>9.17</td>\n",
       "      <td>16.71</td>\n",
       "      <td>1969-01-01</td>\n",
       "      <td>1</td>\n",
       "      <td>1969</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1970-01-01</th>\n",
       "      <td>9.59</td>\n",
       "      <td>2.96</td>\n",
       "      <td>11.79</td>\n",
       "      <td>3.42</td>\n",
       "      <td>6.13</td>\n",
       "      <td>4.08</td>\n",
       "      <td>9.00</td>\n",
       "      <td>4.46</td>\n",
       "      <td>7.29</td>\n",
       "      <td>3.50</td>\n",
       "      <td>7.33</td>\n",
       "      <td>13.00</td>\n",
       "      <td>1970-01-01</td>\n",
       "      <td>1</td>\n",
       "      <td>1970</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1971-01-01</th>\n",
       "      <td>3.71</td>\n",
       "      <td>0.79</td>\n",
       "      <td>4.71</td>\n",
       "      <td>0.17</td>\n",
       "      <td>1.42</td>\n",
       "      <td>1.04</td>\n",
       "      <td>4.63</td>\n",
       "      <td>0.75</td>\n",
       "      <td>1.54</td>\n",
       "      <td>1.08</td>\n",
       "      <td>4.21</td>\n",
       "      <td>9.54</td>\n",
       "      <td>1971-01-01</td>\n",
       "      <td>1</td>\n",
       "      <td>1971</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1972-01-01</th>\n",
       "      <td>9.29</td>\n",
       "      <td>3.63</td>\n",
       "      <td>14.54</td>\n",
       "      <td>4.25</td>\n",
       "      <td>6.75</td>\n",
       "      <td>4.42</td>\n",
       "      <td>13.00</td>\n",
       "      <td>5.33</td>\n",
       "      <td>10.04</td>\n",
       "      <td>8.54</td>\n",
       "      <td>8.71</td>\n",
       "      <td>19.17</td>\n",
       "      <td>1972-01-01</td>\n",
       "      <td>1</td>\n",
       "      <td>1972</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1973-01-01</th>\n",
       "      <td>16.50</td>\n",
       "      <td>15.92</td>\n",
       "      <td>14.62</td>\n",
       "      <td>7.41</td>\n",
       "      <td>8.29</td>\n",
       "      <td>11.21</td>\n",
       "      <td>13.54</td>\n",
       "      <td>7.79</td>\n",
       "      <td>10.46</td>\n",
       "      <td>10.79</td>\n",
       "      <td>13.37</td>\n",
       "      <td>9.71</td>\n",
       "      <td>1973-01-01</td>\n",
       "      <td>1</td>\n",
       "      <td>1973</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1974-01-01</th>\n",
       "      <td>23.21</td>\n",
       "      <td>16.54</td>\n",
       "      <td>16.08</td>\n",
       "      <td>9.75</td>\n",
       "      <td>15.83</td>\n",
       "      <td>11.46</td>\n",
       "      <td>9.54</td>\n",
       "      <td>13.54</td>\n",
       "      <td>13.83</td>\n",
       "      <td>16.66</td>\n",
       "      <td>17.21</td>\n",
       "      <td>25.29</td>\n",
       "      <td>1974-01-01</td>\n",
       "      <td>1</td>\n",
       "      <td>1974</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1975-01-01</th>\n",
       "      <td>14.04</td>\n",
       "      <td>13.54</td>\n",
       "      <td>11.29</td>\n",
       "      <td>5.46</td>\n",
       "      <td>12.58</td>\n",
       "      <td>5.58</td>\n",
       "      <td>8.12</td>\n",
       "      <td>8.96</td>\n",
       "      <td>9.29</td>\n",
       "      <td>5.17</td>\n",
       "      <td>7.71</td>\n",
       "      <td>11.63</td>\n",
       "      <td>1975-01-01</td>\n",
       "      <td>1</td>\n",
       "      <td>1975</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1976-01-01</th>\n",
       "      <td>18.34</td>\n",
       "      <td>17.67</td>\n",
       "      <td>14.83</td>\n",
       "      <td>8.00</td>\n",
       "      <td>16.62</td>\n",
       "      <td>10.13</td>\n",
       "      <td>13.17</td>\n",
       "      <td>9.04</td>\n",
       "      <td>13.13</td>\n",
       "      <td>5.75</td>\n",
       "      <td>11.38</td>\n",
       "      <td>14.96</td>\n",
       "      <td>1976-01-01</td>\n",
       "      <td>1</td>\n",
       "      <td>1976</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1977-01-01</th>\n",
       "      <td>20.04</td>\n",
       "      <td>11.92</td>\n",
       "      <td>20.25</td>\n",
       "      <td>9.13</td>\n",
       "      <td>9.29</td>\n",
       "      <td>8.04</td>\n",
       "      <td>10.75</td>\n",
       "      <td>5.88</td>\n",
       "      <td>9.00</td>\n",
       "      <td>9.00</td>\n",
       "      <td>14.88</td>\n",
       "      <td>25.70</td>\n",
       "      <td>1977-01-01</td>\n",
       "      <td>1</td>\n",
       "      <td>1977</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1978-01-01</th>\n",
       "      <td>8.33</td>\n",
       "      <td>7.12</td>\n",
       "      <td>7.71</td>\n",
       "      <td>3.54</td>\n",
       "      <td>8.50</td>\n",
       "      <td>7.50</td>\n",
       "      <td>14.71</td>\n",
       "      <td>10.00</td>\n",
       "      <td>11.83</td>\n",
       "      <td>10.00</td>\n",
       "      <td>15.09</td>\n",
       "      <td>20.46</td>\n",
       "      <td>1978-01-01</td>\n",
       "      <td>1</td>\n",
       "      <td>1978</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "              RPT    VAL    ROS    KIL    SHA    BIR    DUB    CLA    MUL  \\\n",
       "Yr_Mo_Dy                                                                    \n",
       "1961-01-01  15.04  14.96  13.17   9.29    NaN   9.87  13.67  10.25  10.83   \n",
       "1962-01-01   9.29   3.42  11.54   3.50   2.21   1.96  10.41   2.79   3.54   \n",
       "1963-01-01  15.59  13.62  19.79   8.38  12.25  10.00  23.45  15.71  13.59   \n",
       "1964-01-01  25.80  22.13  18.21  13.25  21.29  14.79  14.12  19.58  13.25   \n",
       "1965-01-01   9.54  11.92   9.00   4.38   6.08   5.21  10.25   6.08   5.71   \n",
       "1966-01-01  22.04  21.50  17.08  12.75  22.17  15.59  21.79  18.12  16.66   \n",
       "1967-01-01   6.46   4.46   6.50   3.21   6.67   3.79  11.38   3.83   7.71   \n",
       "1968-01-01  30.04  17.88  16.25  16.25  21.79  12.54  18.16  16.62  18.75   \n",
       "1969-01-01   6.13   1.63   5.41   1.08   2.54   1.00   8.50   2.42   4.58   \n",
       "1970-01-01   9.59   2.96  11.79   3.42   6.13   4.08   9.00   4.46   7.29   \n",
       "1971-01-01   3.71   0.79   4.71   0.17   1.42   1.04   4.63   0.75   1.54   \n",
       "1972-01-01   9.29   3.63  14.54   4.25   6.75   4.42  13.00   5.33  10.04   \n",
       "1973-01-01  16.50  15.92  14.62   7.41   8.29  11.21  13.54   7.79  10.46   \n",
       "1974-01-01  23.21  16.54  16.08   9.75  15.83  11.46   9.54  13.54  13.83   \n",
       "1975-01-01  14.04  13.54  11.29   5.46  12.58   5.58   8.12   8.96   9.29   \n",
       "1976-01-01  18.34  17.67  14.83   8.00  16.62  10.13  13.17   9.04  13.13   \n",
       "1977-01-01  20.04  11.92  20.25   9.13   9.29   8.04  10.75   5.88   9.00   \n",
       "1978-01-01   8.33   7.12   7.71   3.54   8.50   7.50  14.71  10.00  11.83   \n",
       "\n",
       "              CLO    BEL    MAL       date  month  year  day  \n",
       "Yr_Mo_Dy                                                      \n",
       "1961-01-01  12.58  18.50  15.04 1961-01-01      1  1961    1  \n",
       "1962-01-01   5.17   4.38   7.92 1962-01-01      1  1962    1  \n",
       "1963-01-01  14.37  17.58  34.13 1963-01-01      1  1963    1  \n",
       "1964-01-01  16.75  28.96  21.00 1964-01-01      1  1964    1  \n",
       "1965-01-01   8.63  12.04  17.41 1965-01-01      1  1965    1  \n",
       "1966-01-01  17.83  28.33  23.79 1966-01-01      1  1966    1  \n",
       "1967-01-01   9.08  10.67  20.91 1967-01-01      1  1967    1  \n",
       "1968-01-01  17.62  22.25  27.29 1968-01-01      1  1968    1  \n",
       "1969-01-01   6.34   9.17  16.71 1969-01-01      1  1969    1  \n",
       "1970-01-01   3.50   7.33  13.00 1970-01-01      1  1970    1  \n",
       "1971-01-01   1.08   4.21   9.54 1971-01-01      1  1971    1  \n",
       "1972-01-01   8.54   8.71  19.17 1972-01-01      1  1972    1  \n",
       "1973-01-01  10.79  13.37   9.71 1973-01-01      1  1973    1  \n",
       "1974-01-01  16.66  17.21  25.29 1974-01-01      1  1974    1  \n",
       "1975-01-01   5.17   7.71  11.63 1975-01-01      1  1975    1  \n",
       "1976-01-01   5.75  11.38  14.96 1976-01-01      1  1976    1  \n",
       "1977-01-01   9.00  14.88  25.70 1977-01-01      1  1977    1  \n",
       "1978-01-01  10.00  15.09  20.46 1978-01-01      1  1978    1  "
      ]
     },
     "execution_count": 428,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data.query('month == 1 and day == 1')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Step 13. Downsample the record to a monthly frequency for each location."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 429,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>RPT</th>\n",
       "      <th>VAL</th>\n",
       "      <th>ROS</th>\n",
       "      <th>KIL</th>\n",
       "      <th>SHA</th>\n",
       "      <th>BIR</th>\n",
       "      <th>DUB</th>\n",
       "      <th>CLA</th>\n",
       "      <th>MUL</th>\n",
       "      <th>CLO</th>\n",
       "      <th>BEL</th>\n",
       "      <th>MAL</th>\n",
       "      <th>date</th>\n",
       "      <th>month</th>\n",
       "      <th>year</th>\n",
       "      <th>day</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Yr_Mo_Dy</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>1961-01-01</th>\n",
       "      <td>15.04</td>\n",
       "      <td>14.96</td>\n",
       "      <td>13.17</td>\n",
       "      <td>9.29</td>\n",
       "      <td>NaN</td>\n",
       "      <td>9.87</td>\n",
       "      <td>13.67</td>\n",
       "      <td>10.25</td>\n",
       "      <td>10.83</td>\n",
       "      <td>12.58</td>\n",
       "      <td>18.50</td>\n",
       "      <td>15.04</td>\n",
       "      <td>1961-01-01</td>\n",
       "      <td>1</td>\n",
       "      <td>1961</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1961-02-01</th>\n",
       "      <td>14.25</td>\n",
       "      <td>15.12</td>\n",
       "      <td>9.04</td>\n",
       "      <td>5.88</td>\n",
       "      <td>12.08</td>\n",
       "      <td>7.17</td>\n",
       "      <td>10.17</td>\n",
       "      <td>3.63</td>\n",
       "      <td>6.50</td>\n",
       "      <td>5.50</td>\n",
       "      <td>9.17</td>\n",
       "      <td>8.00</td>\n",
       "      <td>1961-02-01</td>\n",
       "      <td>2</td>\n",
       "      <td>1961</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1961-03-01</th>\n",
       "      <td>12.67</td>\n",
       "      <td>13.13</td>\n",
       "      <td>11.79</td>\n",
       "      <td>6.42</td>\n",
       "      <td>9.79</td>\n",
       "      <td>8.54</td>\n",
       "      <td>10.25</td>\n",
       "      <td>13.29</td>\n",
       "      <td>NaN</td>\n",
       "      <td>12.21</td>\n",
       "      <td>20.62</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1961-03-01</td>\n",
       "      <td>3</td>\n",
       "      <td>1961</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1961-04-01</th>\n",
       "      <td>8.38</td>\n",
       "      <td>6.34</td>\n",
       "      <td>8.33</td>\n",
       "      <td>6.75</td>\n",
       "      <td>9.33</td>\n",
       "      <td>9.54</td>\n",
       "      <td>11.67</td>\n",
       "      <td>8.21</td>\n",
       "      <td>11.21</td>\n",
       "      <td>6.46</td>\n",
       "      <td>11.96</td>\n",
       "      <td>7.17</td>\n",
       "      <td>1961-04-01</td>\n",
       "      <td>4</td>\n",
       "      <td>1961</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1961-05-01</th>\n",
       "      <td>15.87</td>\n",
       "      <td>13.88</td>\n",
       "      <td>15.37</td>\n",
       "      <td>9.79</td>\n",
       "      <td>13.46</td>\n",
       "      <td>10.17</td>\n",
       "      <td>9.96</td>\n",
       "      <td>14.04</td>\n",
       "      <td>9.75</td>\n",
       "      <td>9.92</td>\n",
       "      <td>18.63</td>\n",
       "      <td>11.12</td>\n",
       "      <td>1961-05-01</td>\n",
       "      <td>5</td>\n",
       "      <td>1961</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1961-06-01</th>\n",
       "      <td>15.92</td>\n",
       "      <td>9.59</td>\n",
       "      <td>12.04</td>\n",
       "      <td>8.79</td>\n",
       "      <td>11.54</td>\n",
       "      <td>6.04</td>\n",
       "      <td>9.75</td>\n",
       "      <td>8.29</td>\n",
       "      <td>9.33</td>\n",
       "      <td>10.34</td>\n",
       "      <td>10.67</td>\n",
       "      <td>12.12</td>\n",
       "      <td>1961-06-01</td>\n",
       "      <td>6</td>\n",
       "      <td>1961</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1961-07-01</th>\n",
       "      <td>7.21</td>\n",
       "      <td>6.83</td>\n",
       "      <td>7.71</td>\n",
       "      <td>4.42</td>\n",
       "      <td>8.46</td>\n",
       "      <td>4.79</td>\n",
       "      <td>6.71</td>\n",
       "      <td>6.00</td>\n",
       "      <td>5.79</td>\n",
       "      <td>7.96</td>\n",
       "      <td>6.96</td>\n",
       "      <td>8.71</td>\n",
       "      <td>1961-07-01</td>\n",
       "      <td>7</td>\n",
       "      <td>1961</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1961-08-01</th>\n",
       "      <td>9.59</td>\n",
       "      <td>5.09</td>\n",
       "      <td>5.54</td>\n",
       "      <td>4.63</td>\n",
       "      <td>8.29</td>\n",
       "      <td>5.25</td>\n",
       "      <td>4.21</td>\n",
       "      <td>5.25</td>\n",
       "      <td>5.37</td>\n",
       "      <td>5.41</td>\n",
       "      <td>8.38</td>\n",
       "      <td>9.08</td>\n",
       "      <td>1961-08-01</td>\n",
       "      <td>8</td>\n",
       "      <td>1961</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1961-09-01</th>\n",
       "      <td>5.58</td>\n",
       "      <td>1.13</td>\n",
       "      <td>4.96</td>\n",
       "      <td>3.04</td>\n",
       "      <td>4.25</td>\n",
       "      <td>2.25</td>\n",
       "      <td>4.63</td>\n",
       "      <td>2.71</td>\n",
       "      <td>3.67</td>\n",
       "      <td>6.00</td>\n",
       "      <td>4.79</td>\n",
       "      <td>5.41</td>\n",
       "      <td>1961-09-01</td>\n",
       "      <td>9</td>\n",
       "      <td>1961</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1961-10-01</th>\n",
       "      <td>14.25</td>\n",
       "      <td>12.87</td>\n",
       "      <td>7.87</td>\n",
       "      <td>8.00</td>\n",
       "      <td>13.00</td>\n",
       "      <td>7.75</td>\n",
       "      <td>5.83</td>\n",
       "      <td>9.00</td>\n",
       "      <td>7.08</td>\n",
       "      <td>5.29</td>\n",
       "      <td>11.79</td>\n",
       "      <td>4.04</td>\n",
       "      <td>1961-10-01</td>\n",
       "      <td>10</td>\n",
       "      <td>1961</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1961-11-01</th>\n",
       "      <td>13.21</td>\n",
       "      <td>13.13</td>\n",
       "      <td>14.33</td>\n",
       "      <td>8.54</td>\n",
       "      <td>12.17</td>\n",
       "      <td>10.21</td>\n",
       "      <td>13.08</td>\n",
       "      <td>12.17</td>\n",
       "      <td>10.92</td>\n",
       "      <td>13.54</td>\n",
       "      <td>20.17</td>\n",
       "      <td>20.04</td>\n",
       "      <td>1961-11-01</td>\n",
       "      <td>11</td>\n",
       "      <td>1961</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1961-12-01</th>\n",
       "      <td>9.67</td>\n",
       "      <td>7.75</td>\n",
       "      <td>8.00</td>\n",
       "      <td>3.96</td>\n",
       "      <td>6.00</td>\n",
       "      <td>2.75</td>\n",
       "      <td>7.25</td>\n",
       "      <td>2.50</td>\n",
       "      <td>5.58</td>\n",
       "      <td>5.58</td>\n",
       "      <td>7.79</td>\n",
       "      <td>11.17</td>\n",
       "      <td>1961-12-01</td>\n",
       "      <td>12</td>\n",
       "      <td>1961</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1962-01-01</th>\n",
       "      <td>9.29</td>\n",
       "      <td>3.42</td>\n",
       "      <td>11.54</td>\n",
       "      <td>3.50</td>\n",
       "      <td>2.21</td>\n",
       "      <td>1.96</td>\n",
       "      <td>10.41</td>\n",
       "      <td>2.79</td>\n",
       "      <td>3.54</td>\n",
       "      <td>5.17</td>\n",
       "      <td>4.38</td>\n",
       "      <td>7.92</td>\n",
       "      <td>1962-01-01</td>\n",
       "      <td>1</td>\n",
       "      <td>1962</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1962-02-01</th>\n",
       "      <td>19.12</td>\n",
       "      <td>13.96</td>\n",
       "      <td>12.21</td>\n",
       "      <td>10.58</td>\n",
       "      <td>15.71</td>\n",
       "      <td>10.63</td>\n",
       "      <td>15.71</td>\n",
       "      <td>11.08</td>\n",
       "      <td>13.17</td>\n",
       "      <td>12.62</td>\n",
       "      <td>17.67</td>\n",
       "      <td>22.71</td>\n",
       "      <td>1962-02-01</td>\n",
       "      <td>2</td>\n",
       "      <td>1962</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1962-03-01</th>\n",
       "      <td>8.21</td>\n",
       "      <td>4.83</td>\n",
       "      <td>9.00</td>\n",
       "      <td>4.83</td>\n",
       "      <td>6.00</td>\n",
       "      <td>2.21</td>\n",
       "      <td>7.96</td>\n",
       "      <td>1.87</td>\n",
       "      <td>4.08</td>\n",
       "      <td>3.92</td>\n",
       "      <td>4.08</td>\n",
       "      <td>5.41</td>\n",
       "      <td>1962-03-01</td>\n",
       "      <td>3</td>\n",
       "      <td>1962</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1962-04-01</th>\n",
       "      <td>14.33</td>\n",
       "      <td>12.25</td>\n",
       "      <td>11.87</td>\n",
       "      <td>10.37</td>\n",
       "      <td>14.92</td>\n",
       "      <td>11.00</td>\n",
       "      <td>19.79</td>\n",
       "      <td>11.67</td>\n",
       "      <td>14.09</td>\n",
       "      <td>15.46</td>\n",
       "      <td>16.62</td>\n",
       "      <td>23.58</td>\n",
       "      <td>1962-04-01</td>\n",
       "      <td>4</td>\n",
       "      <td>1962</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1962-05-01</th>\n",
       "      <td>9.62</td>\n",
       "      <td>9.54</td>\n",
       "      <td>3.58</td>\n",
       "      <td>3.33</td>\n",
       "      <td>8.75</td>\n",
       "      <td>3.75</td>\n",
       "      <td>2.25</td>\n",
       "      <td>2.58</td>\n",
       "      <td>1.67</td>\n",
       "      <td>2.37</td>\n",
       "      <td>7.29</td>\n",
       "      <td>3.25</td>\n",
       "      <td>1962-05-01</td>\n",
       "      <td>5</td>\n",
       "      <td>1962</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1962-06-01</th>\n",
       "      <td>5.88</td>\n",
       "      <td>6.29</td>\n",
       "      <td>8.67</td>\n",
       "      <td>5.21</td>\n",
       "      <td>5.00</td>\n",
       "      <td>4.25</td>\n",
       "      <td>5.91</td>\n",
       "      <td>5.41</td>\n",
       "      <td>4.79</td>\n",
       "      <td>9.25</td>\n",
       "      <td>5.25</td>\n",
       "      <td>10.71</td>\n",
       "      <td>1962-06-01</td>\n",
       "      <td>6</td>\n",
       "      <td>1962</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1962-07-01</th>\n",
       "      <td>8.67</td>\n",
       "      <td>4.17</td>\n",
       "      <td>6.92</td>\n",
       "      <td>6.71</td>\n",
       "      <td>8.17</td>\n",
       "      <td>5.66</td>\n",
       "      <td>11.17</td>\n",
       "      <td>9.38</td>\n",
       "      <td>8.75</td>\n",
       "      <td>11.12</td>\n",
       "      <td>10.25</td>\n",
       "      <td>17.08</td>\n",
       "      <td>1962-07-01</td>\n",
       "      <td>7</td>\n",
       "      <td>1962</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1962-08-01</th>\n",
       "      <td>4.58</td>\n",
       "      <td>5.37</td>\n",
       "      <td>6.04</td>\n",
       "      <td>2.29</td>\n",
       "      <td>7.87</td>\n",
       "      <td>3.71</td>\n",
       "      <td>4.46</td>\n",
       "      <td>2.58</td>\n",
       "      <td>4.00</td>\n",
       "      <td>4.79</td>\n",
       "      <td>7.21</td>\n",
       "      <td>7.46</td>\n",
       "      <td>1962-08-01</td>\n",
       "      <td>8</td>\n",
       "      <td>1962</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1962-09-01</th>\n",
       "      <td>10.00</td>\n",
       "      <td>12.08</td>\n",
       "      <td>10.96</td>\n",
       "      <td>9.25</td>\n",
       "      <td>9.29</td>\n",
       "      <td>7.62</td>\n",
       "      <td>7.41</td>\n",
       "      <td>8.75</td>\n",
       "      <td>7.67</td>\n",
       "      <td>9.62</td>\n",
       "      <td>14.58</td>\n",
       "      <td>11.92</td>\n",
       "      <td>1962-09-01</td>\n",
       "      <td>9</td>\n",
       "      <td>1962</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1962-10-01</th>\n",
       "      <td>14.58</td>\n",
       "      <td>7.83</td>\n",
       "      <td>19.21</td>\n",
       "      <td>10.08</td>\n",
       "      <td>11.54</td>\n",
       "      <td>8.38</td>\n",
       "      <td>13.29</td>\n",
       "      <td>10.63</td>\n",
       "      <td>8.21</td>\n",
       "      <td>12.92</td>\n",
       "      <td>18.05</td>\n",
       "      <td>18.12</td>\n",
       "      <td>1962-10-01</td>\n",
       "      <td>10</td>\n",
       "      <td>1962</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1962-11-01</th>\n",
       "      <td>16.88</td>\n",
       "      <td>13.25</td>\n",
       "      <td>16.00</td>\n",
       "      <td>8.96</td>\n",
       "      <td>13.46</td>\n",
       "      <td>11.46</td>\n",
       "      <td>10.46</td>\n",
       "      <td>10.17</td>\n",
       "      <td>10.37</td>\n",
       "      <td>13.21</td>\n",
       "      <td>14.83</td>\n",
       "      <td>15.16</td>\n",
       "      <td>1962-11-01</td>\n",
       "      <td>11</td>\n",
       "      <td>1962</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1962-12-01</th>\n",
       "      <td>18.38</td>\n",
       "      <td>15.41</td>\n",
       "      <td>11.75</td>\n",
       "      <td>6.79</td>\n",
       "      <td>12.21</td>\n",
       "      <td>8.04</td>\n",
       "      <td>8.42</td>\n",
       "      <td>10.83</td>\n",
       "      <td>5.66</td>\n",
       "      <td>9.08</td>\n",
       "      <td>11.50</td>\n",
       "      <td>11.50</td>\n",
       "      <td>1962-12-01</td>\n",
       "      <td>12</td>\n",
       "      <td>1962</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1963-01-01</th>\n",
       "      <td>15.59</td>\n",
       "      <td>13.62</td>\n",
       "      <td>19.79</td>\n",
       "      <td>8.38</td>\n",
       "      <td>12.25</td>\n",
       "      <td>10.00</td>\n",
       "      <td>23.45</td>\n",
       "      <td>15.71</td>\n",
       "      <td>13.59</td>\n",
       "      <td>14.37</td>\n",
       "      <td>17.58</td>\n",
       "      <td>34.13</td>\n",
       "      <td>1963-01-01</td>\n",
       "      <td>1</td>\n",
       "      <td>1963</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1963-02-01</th>\n",
       "      <td>15.41</td>\n",
       "      <td>7.62</td>\n",
       "      <td>24.67</td>\n",
       "      <td>11.42</td>\n",
       "      <td>9.21</td>\n",
       "      <td>8.17</td>\n",
       "      <td>14.04</td>\n",
       "      <td>7.54</td>\n",
       "      <td>7.54</td>\n",
       "      <td>10.08</td>\n",
       "      <td>10.17</td>\n",
       "      <td>17.67</td>\n",
       "      <td>1963-02-01</td>\n",
       "      <td>2</td>\n",
       "      <td>1963</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1963-03-01</th>\n",
       "      <td>16.75</td>\n",
       "      <td>19.67</td>\n",
       "      <td>17.67</td>\n",
       "      <td>8.87</td>\n",
       "      <td>19.08</td>\n",
       "      <td>15.37</td>\n",
       "      <td>16.21</td>\n",
       "      <td>14.29</td>\n",
       "      <td>11.29</td>\n",
       "      <td>9.21</td>\n",
       "      <td>19.92</td>\n",
       "      <td>19.79</td>\n",
       "      <td>1963-03-01</td>\n",
       "      <td>3</td>\n",
       "      <td>1963</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1963-04-01</th>\n",
       "      <td>10.54</td>\n",
       "      <td>9.59</td>\n",
       "      <td>12.46</td>\n",
       "      <td>7.33</td>\n",
       "      <td>9.46</td>\n",
       "      <td>9.59</td>\n",
       "      <td>11.79</td>\n",
       "      <td>11.87</td>\n",
       "      <td>9.79</td>\n",
       "      <td>10.71</td>\n",
       "      <td>13.37</td>\n",
       "      <td>18.21</td>\n",
       "      <td>1963-04-01</td>\n",
       "      <td>4</td>\n",
       "      <td>1963</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1963-05-01</th>\n",
       "      <td>18.79</td>\n",
       "      <td>14.17</td>\n",
       "      <td>13.59</td>\n",
       "      <td>11.63</td>\n",
       "      <td>14.17</td>\n",
       "      <td>11.96</td>\n",
       "      <td>14.46</td>\n",
       "      <td>12.46</td>\n",
       "      <td>12.87</td>\n",
       "      <td>13.96</td>\n",
       "      <td>15.29</td>\n",
       "      <td>21.62</td>\n",
       "      <td>1963-05-01</td>\n",
       "      <td>5</td>\n",
       "      <td>1963</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1963-06-01</th>\n",
       "      <td>13.37</td>\n",
       "      <td>6.87</td>\n",
       "      <td>12.00</td>\n",
       "      <td>8.50</td>\n",
       "      <td>10.04</td>\n",
       "      <td>9.42</td>\n",
       "      <td>10.92</td>\n",
       "      <td>12.96</td>\n",
       "      <td>11.79</td>\n",
       "      <td>11.04</td>\n",
       "      <td>10.92</td>\n",
       "      <td>13.67</td>\n",
       "      <td>1963-06-01</td>\n",
       "      <td>6</td>\n",
       "      <td>1963</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1976-07-01</th>\n",
       "      <td>8.50</td>\n",
       "      <td>1.75</td>\n",
       "      <td>6.58</td>\n",
       "      <td>2.13</td>\n",
       "      <td>2.75</td>\n",
       "      <td>2.21</td>\n",
       "      <td>5.37</td>\n",
       "      <td>2.04</td>\n",
       "      <td>5.88</td>\n",
       "      <td>4.50</td>\n",
       "      <td>4.96</td>\n",
       "      <td>10.63</td>\n",
       "      <td>1976-07-01</td>\n",
       "      <td>7</td>\n",
       "      <td>1976</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1976-08-01</th>\n",
       "      <td>13.00</td>\n",
       "      <td>8.38</td>\n",
       "      <td>8.63</td>\n",
       "      <td>5.83</td>\n",
       "      <td>12.92</td>\n",
       "      <td>8.25</td>\n",
       "      <td>13.00</td>\n",
       "      <td>9.42</td>\n",
       "      <td>10.58</td>\n",
       "      <td>11.34</td>\n",
       "      <td>14.21</td>\n",
       "      <td>20.25</td>\n",
       "      <td>1976-08-01</td>\n",
       "      <td>8</td>\n",
       "      <td>1976</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1976-09-01</th>\n",
       "      <td>11.87</td>\n",
       "      <td>11.00</td>\n",
       "      <td>7.38</td>\n",
       "      <td>6.87</td>\n",
       "      <td>7.75</td>\n",
       "      <td>8.33</td>\n",
       "      <td>10.34</td>\n",
       "      <td>6.46</td>\n",
       "      <td>10.17</td>\n",
       "      <td>9.29</td>\n",
       "      <td>12.75</td>\n",
       "      <td>19.55</td>\n",
       "      <td>1976-09-01</td>\n",
       "      <td>9</td>\n",
       "      <td>1976</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1976-10-01</th>\n",
       "      <td>10.96</td>\n",
       "      <td>6.71</td>\n",
       "      <td>10.41</td>\n",
       "      <td>4.63</td>\n",
       "      <td>7.58</td>\n",
       "      <td>5.04</td>\n",
       "      <td>5.04</td>\n",
       "      <td>5.54</td>\n",
       "      <td>6.50</td>\n",
       "      <td>3.92</td>\n",
       "      <td>6.79</td>\n",
       "      <td>5.00</td>\n",
       "      <td>1976-10-01</td>\n",
       "      <td>10</td>\n",
       "      <td>1976</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1976-11-01</th>\n",
       "      <td>13.96</td>\n",
       "      <td>15.67</td>\n",
       "      <td>10.29</td>\n",
       "      <td>6.46</td>\n",
       "      <td>12.79</td>\n",
       "      <td>9.08</td>\n",
       "      <td>10.00</td>\n",
       "      <td>9.67</td>\n",
       "      <td>10.21</td>\n",
       "      <td>11.63</td>\n",
       "      <td>23.09</td>\n",
       "      <td>21.96</td>\n",
       "      <td>1976-11-01</td>\n",
       "      <td>11</td>\n",
       "      <td>1976</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1976-12-01</th>\n",
       "      <td>13.46</td>\n",
       "      <td>16.42</td>\n",
       "      <td>9.21</td>\n",
       "      <td>4.54</td>\n",
       "      <td>10.75</td>\n",
       "      <td>8.67</td>\n",
       "      <td>10.88</td>\n",
       "      <td>4.83</td>\n",
       "      <td>8.79</td>\n",
       "      <td>5.91</td>\n",
       "      <td>8.83</td>\n",
       "      <td>13.67</td>\n",
       "      <td>1976-12-01</td>\n",
       "      <td>12</td>\n",
       "      <td>1976</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1977-01-01</th>\n",
       "      <td>20.04</td>\n",
       "      <td>11.92</td>\n",
       "      <td>20.25</td>\n",
       "      <td>9.13</td>\n",
       "      <td>9.29</td>\n",
       "      <td>8.04</td>\n",
       "      <td>10.75</td>\n",
       "      <td>5.88</td>\n",
       "      <td>9.00</td>\n",
       "      <td>9.00</td>\n",
       "      <td>14.88</td>\n",
       "      <td>25.70</td>\n",
       "      <td>1977-01-01</td>\n",
       "      <td>1</td>\n",
       "      <td>1977</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1977-02-01</th>\n",
       "      <td>11.83</td>\n",
       "      <td>9.71</td>\n",
       "      <td>11.00</td>\n",
       "      <td>4.25</td>\n",
       "      <td>8.58</td>\n",
       "      <td>8.71</td>\n",
       "      <td>6.17</td>\n",
       "      <td>5.66</td>\n",
       "      <td>8.29</td>\n",
       "      <td>7.58</td>\n",
       "      <td>11.71</td>\n",
       "      <td>16.50</td>\n",
       "      <td>1977-02-01</td>\n",
       "      <td>2</td>\n",
       "      <td>1977</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1977-03-01</th>\n",
       "      <td>8.63</td>\n",
       "      <td>14.83</td>\n",
       "      <td>10.29</td>\n",
       "      <td>3.75</td>\n",
       "      <td>6.63</td>\n",
       "      <td>8.79</td>\n",
       "      <td>5.00</td>\n",
       "      <td>8.12</td>\n",
       "      <td>7.87</td>\n",
       "      <td>6.42</td>\n",
       "      <td>13.54</td>\n",
       "      <td>13.67</td>\n",
       "      <td>1977-03-01</td>\n",
       "      <td>3</td>\n",
       "      <td>1977</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1977-04-01</th>\n",
       "      <td>21.67</td>\n",
       "      <td>16.00</td>\n",
       "      <td>17.33</td>\n",
       "      <td>13.59</td>\n",
       "      <td>20.83</td>\n",
       "      <td>15.96</td>\n",
       "      <td>25.62</td>\n",
       "      <td>17.62</td>\n",
       "      <td>19.41</td>\n",
       "      <td>20.67</td>\n",
       "      <td>24.37</td>\n",
       "      <td>30.09</td>\n",
       "      <td>1977-04-01</td>\n",
       "      <td>4</td>\n",
       "      <td>1977</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1977-05-01</th>\n",
       "      <td>6.42</td>\n",
       "      <td>7.12</td>\n",
       "      <td>8.67</td>\n",
       "      <td>3.58</td>\n",
       "      <td>4.58</td>\n",
       "      <td>4.00</td>\n",
       "      <td>6.75</td>\n",
       "      <td>6.13</td>\n",
       "      <td>3.33</td>\n",
       "      <td>4.50</td>\n",
       "      <td>19.21</td>\n",
       "      <td>12.38</td>\n",
       "      <td>1977-05-01</td>\n",
       "      <td>5</td>\n",
       "      <td>1977</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1977-06-01</th>\n",
       "      <td>7.08</td>\n",
       "      <td>5.25</td>\n",
       "      <td>9.71</td>\n",
       "      <td>2.83</td>\n",
       "      <td>2.21</td>\n",
       "      <td>3.50</td>\n",
       "      <td>5.29</td>\n",
       "      <td>1.42</td>\n",
       "      <td>2.00</td>\n",
       "      <td>0.92</td>\n",
       "      <td>5.21</td>\n",
       "      <td>5.63</td>\n",
       "      <td>1977-06-01</td>\n",
       "      <td>6</td>\n",
       "      <td>1977</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1977-07-01</th>\n",
       "      <td>15.41</td>\n",
       "      <td>16.29</td>\n",
       "      <td>17.08</td>\n",
       "      <td>6.25</td>\n",
       "      <td>11.83</td>\n",
       "      <td>11.83</td>\n",
       "      <td>12.29</td>\n",
       "      <td>10.58</td>\n",
       "      <td>10.41</td>\n",
       "      <td>7.21</td>\n",
       "      <td>17.37</td>\n",
       "      <td>7.83</td>\n",
       "      <td>1977-07-01</td>\n",
       "      <td>7</td>\n",
       "      <td>1977</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1977-08-01</th>\n",
       "      <td>4.33</td>\n",
       "      <td>2.96</td>\n",
       "      <td>4.42</td>\n",
       "      <td>2.33</td>\n",
       "      <td>0.96</td>\n",
       "      <td>1.08</td>\n",
       "      <td>4.96</td>\n",
       "      <td>1.87</td>\n",
       "      <td>2.33</td>\n",
       "      <td>2.04</td>\n",
       "      <td>10.50</td>\n",
       "      <td>9.83</td>\n",
       "      <td>1977-08-01</td>\n",
       "      <td>8</td>\n",
       "      <td>1977</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1977-09-01</th>\n",
       "      <td>17.37</td>\n",
       "      <td>16.33</td>\n",
       "      <td>16.83</td>\n",
       "      <td>8.58</td>\n",
       "      <td>14.46</td>\n",
       "      <td>11.83</td>\n",
       "      <td>15.09</td>\n",
       "      <td>13.92</td>\n",
       "      <td>13.29</td>\n",
       "      <td>13.88</td>\n",
       "      <td>23.29</td>\n",
       "      <td>25.17</td>\n",
       "      <td>1977-09-01</td>\n",
       "      <td>9</td>\n",
       "      <td>1977</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1977-10-01</th>\n",
       "      <td>16.75</td>\n",
       "      <td>15.34</td>\n",
       "      <td>12.25</td>\n",
       "      <td>9.42</td>\n",
       "      <td>16.38</td>\n",
       "      <td>11.38</td>\n",
       "      <td>18.50</td>\n",
       "      <td>13.92</td>\n",
       "      <td>14.09</td>\n",
       "      <td>14.46</td>\n",
       "      <td>22.34</td>\n",
       "      <td>29.67</td>\n",
       "      <td>1977-10-01</td>\n",
       "      <td>10</td>\n",
       "      <td>1977</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1977-11-01</th>\n",
       "      <td>16.71</td>\n",
       "      <td>11.54</td>\n",
       "      <td>12.17</td>\n",
       "      <td>4.17</td>\n",
       "      <td>8.54</td>\n",
       "      <td>7.17</td>\n",
       "      <td>11.12</td>\n",
       "      <td>6.46</td>\n",
       "      <td>8.25</td>\n",
       "      <td>6.21</td>\n",
       "      <td>11.04</td>\n",
       "      <td>15.63</td>\n",
       "      <td>1977-11-01</td>\n",
       "      <td>11</td>\n",
       "      <td>1977</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1977-12-01</th>\n",
       "      <td>13.37</td>\n",
       "      <td>10.92</td>\n",
       "      <td>12.42</td>\n",
       "      <td>2.37</td>\n",
       "      <td>5.79</td>\n",
       "      <td>6.13</td>\n",
       "      <td>8.96</td>\n",
       "      <td>7.38</td>\n",
       "      <td>6.29</td>\n",
       "      <td>5.71</td>\n",
       "      <td>8.54</td>\n",
       "      <td>12.42</td>\n",
       "      <td>1977-12-01</td>\n",
       "      <td>12</td>\n",
       "      <td>1977</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1978-01-01</th>\n",
       "      <td>8.33</td>\n",
       "      <td>7.12</td>\n",
       "      <td>7.71</td>\n",
       "      <td>3.54</td>\n",
       "      <td>8.50</td>\n",
       "      <td>7.50</td>\n",
       "      <td>14.71</td>\n",
       "      <td>10.00</td>\n",
       "      <td>11.83</td>\n",
       "      <td>10.00</td>\n",
       "      <td>15.09</td>\n",
       "      <td>20.46</td>\n",
       "      <td>1978-01-01</td>\n",
       "      <td>1</td>\n",
       "      <td>1978</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1978-02-01</th>\n",
       "      <td>27.25</td>\n",
       "      <td>24.21</td>\n",
       "      <td>18.16</td>\n",
       "      <td>17.46</td>\n",
       "      <td>27.54</td>\n",
       "      <td>18.05</td>\n",
       "      <td>20.96</td>\n",
       "      <td>25.04</td>\n",
       "      <td>20.04</td>\n",
       "      <td>17.50</td>\n",
       "      <td>27.71</td>\n",
       "      <td>21.12</td>\n",
       "      <td>1978-02-01</td>\n",
       "      <td>2</td>\n",
       "      <td>1978</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1978-03-01</th>\n",
       "      <td>15.04</td>\n",
       "      <td>6.21</td>\n",
       "      <td>16.04</td>\n",
       "      <td>7.87</td>\n",
       "      <td>6.42</td>\n",
       "      <td>6.67</td>\n",
       "      <td>12.29</td>\n",
       "      <td>8.00</td>\n",
       "      <td>10.58</td>\n",
       "      <td>9.33</td>\n",
       "      <td>5.41</td>\n",
       "      <td>17.00</td>\n",
       "      <td>1978-03-01</td>\n",
       "      <td>3</td>\n",
       "      <td>1978</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1978-04-01</th>\n",
       "      <td>3.42</td>\n",
       "      <td>7.58</td>\n",
       "      <td>2.71</td>\n",
       "      <td>1.38</td>\n",
       "      <td>3.46</td>\n",
       "      <td>2.08</td>\n",
       "      <td>2.67</td>\n",
       "      <td>4.75</td>\n",
       "      <td>4.83</td>\n",
       "      <td>1.67</td>\n",
       "      <td>7.33</td>\n",
       "      <td>13.67</td>\n",
       "      <td>1978-04-01</td>\n",
       "      <td>4</td>\n",
       "      <td>1978</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1978-05-01</th>\n",
       "      <td>10.54</td>\n",
       "      <td>12.21</td>\n",
       "      <td>9.08</td>\n",
       "      <td>5.29</td>\n",
       "      <td>11.00</td>\n",
       "      <td>10.08</td>\n",
       "      <td>11.17</td>\n",
       "      <td>13.75</td>\n",
       "      <td>11.87</td>\n",
       "      <td>11.79</td>\n",
       "      <td>12.87</td>\n",
       "      <td>27.16</td>\n",
       "      <td>1978-05-01</td>\n",
       "      <td>5</td>\n",
       "      <td>1978</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1978-06-01</th>\n",
       "      <td>10.37</td>\n",
       "      <td>11.42</td>\n",
       "      <td>6.46</td>\n",
       "      <td>6.04</td>\n",
       "      <td>11.25</td>\n",
       "      <td>7.50</td>\n",
       "      <td>6.46</td>\n",
       "      <td>5.96</td>\n",
       "      <td>7.79</td>\n",
       "      <td>5.46</td>\n",
       "      <td>5.50</td>\n",
       "      <td>10.41</td>\n",
       "      <td>1978-06-01</td>\n",
       "      <td>6</td>\n",
       "      <td>1978</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1978-07-01</th>\n",
       "      <td>12.46</td>\n",
       "      <td>10.63</td>\n",
       "      <td>11.17</td>\n",
       "      <td>6.75</td>\n",
       "      <td>12.92</td>\n",
       "      <td>9.04</td>\n",
       "      <td>12.42</td>\n",
       "      <td>9.62</td>\n",
       "      <td>12.08</td>\n",
       "      <td>8.04</td>\n",
       "      <td>14.04</td>\n",
       "      <td>16.17</td>\n",
       "      <td>1978-07-01</td>\n",
       "      <td>7</td>\n",
       "      <td>1978</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1978-08-01</th>\n",
       "      <td>19.33</td>\n",
       "      <td>15.09</td>\n",
       "      <td>20.17</td>\n",
       "      <td>8.83</td>\n",
       "      <td>12.62</td>\n",
       "      <td>10.41</td>\n",
       "      <td>9.33</td>\n",
       "      <td>12.33</td>\n",
       "      <td>9.50</td>\n",
       "      <td>9.92</td>\n",
       "      <td>15.75</td>\n",
       "      <td>18.00</td>\n",
       "      <td>1978-08-01</td>\n",
       "      <td>8</td>\n",
       "      <td>1978</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1978-09-01</th>\n",
       "      <td>8.42</td>\n",
       "      <td>6.13</td>\n",
       "      <td>9.87</td>\n",
       "      <td>5.25</td>\n",
       "      <td>3.21</td>\n",
       "      <td>5.71</td>\n",
       "      <td>7.25</td>\n",
       "      <td>3.50</td>\n",
       "      <td>7.33</td>\n",
       "      <td>6.50</td>\n",
       "      <td>7.62</td>\n",
       "      <td>15.96</td>\n",
       "      <td>1978-09-01</td>\n",
       "      <td>9</td>\n",
       "      <td>1978</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1978-10-01</th>\n",
       "      <td>9.50</td>\n",
       "      <td>6.83</td>\n",
       "      <td>10.50</td>\n",
       "      <td>3.88</td>\n",
       "      <td>6.13</td>\n",
       "      <td>4.58</td>\n",
       "      <td>4.21</td>\n",
       "      <td>6.50</td>\n",
       "      <td>6.38</td>\n",
       "      <td>6.54</td>\n",
       "      <td>10.63</td>\n",
       "      <td>14.09</td>\n",
       "      <td>1978-10-01</td>\n",
       "      <td>10</td>\n",
       "      <td>1978</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1978-11-01</th>\n",
       "      <td>13.59</td>\n",
       "      <td>16.75</td>\n",
       "      <td>11.25</td>\n",
       "      <td>7.08</td>\n",
       "      <td>11.04</td>\n",
       "      <td>8.33</td>\n",
       "      <td>8.17</td>\n",
       "      <td>11.29</td>\n",
       "      <td>10.75</td>\n",
       "      <td>11.25</td>\n",
       "      <td>23.13</td>\n",
       "      <td>25.00</td>\n",
       "      <td>1978-11-01</td>\n",
       "      <td>11</td>\n",
       "      <td>1978</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1978-12-01</th>\n",
       "      <td>21.29</td>\n",
       "      <td>16.29</td>\n",
       "      <td>24.04</td>\n",
       "      <td>12.79</td>\n",
       "      <td>18.21</td>\n",
       "      <td>19.29</td>\n",
       "      <td>21.54</td>\n",
       "      <td>17.21</td>\n",
       "      <td>16.71</td>\n",
       "      <td>17.83</td>\n",
       "      <td>17.75</td>\n",
       "      <td>25.70</td>\n",
       "      <td>1978-12-01</td>\n",
       "      <td>12</td>\n",
       "      <td>1978</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>216 rows × 16 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "              RPT    VAL    ROS    KIL    SHA    BIR    DUB    CLA    MUL  \\\n",
       "Yr_Mo_Dy                                                                    \n",
       "1961-01-01  15.04  14.96  13.17   9.29    NaN   9.87  13.67  10.25  10.83   \n",
       "1961-02-01  14.25  15.12   9.04   5.88  12.08   7.17  10.17   3.63   6.50   \n",
       "1961-03-01  12.67  13.13  11.79   6.42   9.79   8.54  10.25  13.29    NaN   \n",
       "1961-04-01   8.38   6.34   8.33   6.75   9.33   9.54  11.67   8.21  11.21   \n",
       "1961-05-01  15.87  13.88  15.37   9.79  13.46  10.17   9.96  14.04   9.75   \n",
       "1961-06-01  15.92   9.59  12.04   8.79  11.54   6.04   9.75   8.29   9.33   \n",
       "1961-07-01   7.21   6.83   7.71   4.42   8.46   4.79   6.71   6.00   5.79   \n",
       "1961-08-01   9.59   5.09   5.54   4.63   8.29   5.25   4.21   5.25   5.37   \n",
       "1961-09-01   5.58   1.13   4.96   3.04   4.25   2.25   4.63   2.71   3.67   \n",
       "1961-10-01  14.25  12.87   7.87   8.00  13.00   7.75   5.83   9.00   7.08   \n",
       "1961-11-01  13.21  13.13  14.33   8.54  12.17  10.21  13.08  12.17  10.92   \n",
       "1961-12-01   9.67   7.75   8.00   3.96   6.00   2.75   7.25   2.50   5.58   \n",
       "1962-01-01   9.29   3.42  11.54   3.50   2.21   1.96  10.41   2.79   3.54   \n",
       "1962-02-01  19.12  13.96  12.21  10.58  15.71  10.63  15.71  11.08  13.17   \n",
       "1962-03-01   8.21   4.83   9.00   4.83   6.00   2.21   7.96   1.87   4.08   \n",
       "1962-04-01  14.33  12.25  11.87  10.37  14.92  11.00  19.79  11.67  14.09   \n",
       "1962-05-01   9.62   9.54   3.58   3.33   8.75   3.75   2.25   2.58   1.67   \n",
       "1962-06-01   5.88   6.29   8.67   5.21   5.00   4.25   5.91   5.41   4.79   \n",
       "1962-07-01   8.67   4.17   6.92   6.71   8.17   5.66  11.17   9.38   8.75   \n",
       "1962-08-01   4.58   5.37   6.04   2.29   7.87   3.71   4.46   2.58   4.00   \n",
       "1962-09-01  10.00  12.08  10.96   9.25   9.29   7.62   7.41   8.75   7.67   \n",
       "1962-10-01  14.58   7.83  19.21  10.08  11.54   8.38  13.29  10.63   8.21   \n",
       "1962-11-01  16.88  13.25  16.00   8.96  13.46  11.46  10.46  10.17  10.37   \n",
       "1962-12-01  18.38  15.41  11.75   6.79  12.21   8.04   8.42  10.83   5.66   \n",
       "1963-01-01  15.59  13.62  19.79   8.38  12.25  10.00  23.45  15.71  13.59   \n",
       "1963-02-01  15.41   7.62  24.67  11.42   9.21   8.17  14.04   7.54   7.54   \n",
       "1963-03-01  16.75  19.67  17.67   8.87  19.08  15.37  16.21  14.29  11.29   \n",
       "1963-04-01  10.54   9.59  12.46   7.33   9.46   9.59  11.79  11.87   9.79   \n",
       "1963-05-01  18.79  14.17  13.59  11.63  14.17  11.96  14.46  12.46  12.87   \n",
       "1963-06-01  13.37   6.87  12.00   8.50  10.04   9.42  10.92  12.96  11.79   \n",
       "...           ...    ...    ...    ...    ...    ...    ...    ...    ...   \n",
       "1976-07-01   8.50   1.75   6.58   2.13   2.75   2.21   5.37   2.04   5.88   \n",
       "1976-08-01  13.00   8.38   8.63   5.83  12.92   8.25  13.00   9.42  10.58   \n",
       "1976-09-01  11.87  11.00   7.38   6.87   7.75   8.33  10.34   6.46  10.17   \n",
       "1976-10-01  10.96   6.71  10.41   4.63   7.58   5.04   5.04   5.54   6.50   \n",
       "1976-11-01  13.96  15.67  10.29   6.46  12.79   9.08  10.00   9.67  10.21   \n",
       "1976-12-01  13.46  16.42   9.21   4.54  10.75   8.67  10.88   4.83   8.79   \n",
       "1977-01-01  20.04  11.92  20.25   9.13   9.29   8.04  10.75   5.88   9.00   \n",
       "1977-02-01  11.83   9.71  11.00   4.25   8.58   8.71   6.17   5.66   8.29   \n",
       "1977-03-01   8.63  14.83  10.29   3.75   6.63   8.79   5.00   8.12   7.87   \n",
       "1977-04-01  21.67  16.00  17.33  13.59  20.83  15.96  25.62  17.62  19.41   \n",
       "1977-05-01   6.42   7.12   8.67   3.58   4.58   4.00   6.75   6.13   3.33   \n",
       "1977-06-01   7.08   5.25   9.71   2.83   2.21   3.50   5.29   1.42   2.00   \n",
       "1977-07-01  15.41  16.29  17.08   6.25  11.83  11.83  12.29  10.58  10.41   \n",
       "1977-08-01   4.33   2.96   4.42   2.33   0.96   1.08   4.96   1.87   2.33   \n",
       "1977-09-01  17.37  16.33  16.83   8.58  14.46  11.83  15.09  13.92  13.29   \n",
       "1977-10-01  16.75  15.34  12.25   9.42  16.38  11.38  18.50  13.92  14.09   \n",
       "1977-11-01  16.71  11.54  12.17   4.17   8.54   7.17  11.12   6.46   8.25   \n",
       "1977-12-01  13.37  10.92  12.42   2.37   5.79   6.13   8.96   7.38   6.29   \n",
       "1978-01-01   8.33   7.12   7.71   3.54   8.50   7.50  14.71  10.00  11.83   \n",
       "1978-02-01  27.25  24.21  18.16  17.46  27.54  18.05  20.96  25.04  20.04   \n",
       "1978-03-01  15.04   6.21  16.04   7.87   6.42   6.67  12.29   8.00  10.58   \n",
       "1978-04-01   3.42   7.58   2.71   1.38   3.46   2.08   2.67   4.75   4.83   \n",
       "1978-05-01  10.54  12.21   9.08   5.29  11.00  10.08  11.17  13.75  11.87   \n",
       "1978-06-01  10.37  11.42   6.46   6.04  11.25   7.50   6.46   5.96   7.79   \n",
       "1978-07-01  12.46  10.63  11.17   6.75  12.92   9.04  12.42   9.62  12.08   \n",
       "1978-08-01  19.33  15.09  20.17   8.83  12.62  10.41   9.33  12.33   9.50   \n",
       "1978-09-01   8.42   6.13   9.87   5.25   3.21   5.71   7.25   3.50   7.33   \n",
       "1978-10-01   9.50   6.83  10.50   3.88   6.13   4.58   4.21   6.50   6.38   \n",
       "1978-11-01  13.59  16.75  11.25   7.08  11.04   8.33   8.17  11.29  10.75   \n",
       "1978-12-01  21.29  16.29  24.04  12.79  18.21  19.29  21.54  17.21  16.71   \n",
       "\n",
       "              CLO    BEL    MAL       date  month  year  day  \n",
       "Yr_Mo_Dy                                                      \n",
       "1961-01-01  12.58  18.50  15.04 1961-01-01      1  1961    1  \n",
       "1961-02-01   5.50   9.17   8.00 1961-02-01      2  1961    1  \n",
       "1961-03-01  12.21  20.62    NaN 1961-03-01      3  1961    1  \n",
       "1961-04-01   6.46  11.96   7.17 1961-04-01      4  1961    1  \n",
       "1961-05-01   9.92  18.63  11.12 1961-05-01      5  1961    1  \n",
       "1961-06-01  10.34  10.67  12.12 1961-06-01      6  1961    1  \n",
       "1961-07-01   7.96   6.96   8.71 1961-07-01      7  1961    1  \n",
       "1961-08-01   5.41   8.38   9.08 1961-08-01      8  1961    1  \n",
       "1961-09-01   6.00   4.79   5.41 1961-09-01      9  1961    1  \n",
       "1961-10-01   5.29  11.79   4.04 1961-10-01     10  1961    1  \n",
       "1961-11-01  13.54  20.17  20.04 1961-11-01     11  1961    1  \n",
       "1961-12-01   5.58   7.79  11.17 1961-12-01     12  1961    1  \n",
       "1962-01-01   5.17   4.38   7.92 1962-01-01      1  1962    1  \n",
       "1962-02-01  12.62  17.67  22.71 1962-02-01      2  1962    1  \n",
       "1962-03-01   3.92   4.08   5.41 1962-03-01      3  1962    1  \n",
       "1962-04-01  15.46  16.62  23.58 1962-04-01      4  1962    1  \n",
       "1962-05-01   2.37   7.29   3.25 1962-05-01      5  1962    1  \n",
       "1962-06-01   9.25   5.25  10.71 1962-06-01      6  1962    1  \n",
       "1962-07-01  11.12  10.25  17.08 1962-07-01      7  1962    1  \n",
       "1962-08-01   4.79   7.21   7.46 1962-08-01      8  1962    1  \n",
       "1962-09-01   9.62  14.58  11.92 1962-09-01      9  1962    1  \n",
       "1962-10-01  12.92  18.05  18.12 1962-10-01     10  1962    1  \n",
       "1962-11-01  13.21  14.83  15.16 1962-11-01     11  1962    1  \n",
       "1962-12-01   9.08  11.50  11.50 1962-12-01     12  1962    1  \n",
       "1963-01-01  14.37  17.58  34.13 1963-01-01      1  1963    1  \n",
       "1963-02-01  10.08  10.17  17.67 1963-02-01      2  1963    1  \n",
       "1963-03-01   9.21  19.92  19.79 1963-03-01      3  1963    1  \n",
       "1963-04-01  10.71  13.37  18.21 1963-04-01      4  1963    1  \n",
       "1963-05-01  13.96  15.29  21.62 1963-05-01      5  1963    1  \n",
       "1963-06-01  11.04  10.92  13.67 1963-06-01      6  1963    1  \n",
       "...           ...    ...    ...        ...    ...   ...  ...  \n",
       "1976-07-01   4.50   4.96  10.63 1976-07-01      7  1976    1  \n",
       "1976-08-01  11.34  14.21  20.25 1976-08-01      8  1976    1  \n",
       "1976-09-01   9.29  12.75  19.55 1976-09-01      9  1976    1  \n",
       "1976-10-01   3.92   6.79   5.00 1976-10-01     10  1976    1  \n",
       "1976-11-01  11.63  23.09  21.96 1976-11-01     11  1976    1  \n",
       "1976-12-01   5.91   8.83  13.67 1976-12-01     12  1976    1  \n",
       "1977-01-01   9.00  14.88  25.70 1977-01-01      1  1977    1  \n",
       "1977-02-01   7.58  11.71  16.50 1977-02-01      2  1977    1  \n",
       "1977-03-01   6.42  13.54  13.67 1977-03-01      3  1977    1  \n",
       "1977-04-01  20.67  24.37  30.09 1977-04-01      4  1977    1  \n",
       "1977-05-01   4.50  19.21  12.38 1977-05-01      5  1977    1  \n",
       "1977-06-01   0.92   5.21   5.63 1977-06-01      6  1977    1  \n",
       "1977-07-01   7.21  17.37   7.83 1977-07-01      7  1977    1  \n",
       "1977-08-01   2.04  10.50   9.83 1977-08-01      8  1977    1  \n",
       "1977-09-01  13.88  23.29  25.17 1977-09-01      9  1977    1  \n",
       "1977-10-01  14.46  22.34  29.67 1977-10-01     10  1977    1  \n",
       "1977-11-01   6.21  11.04  15.63 1977-11-01     11  1977    1  \n",
       "1977-12-01   5.71   8.54  12.42 1977-12-01     12  1977    1  \n",
       "1978-01-01  10.00  15.09  20.46 1978-01-01      1  1978    1  \n",
       "1978-02-01  17.50  27.71  21.12 1978-02-01      2  1978    1  \n",
       "1978-03-01   9.33   5.41  17.00 1978-03-01      3  1978    1  \n",
       "1978-04-01   1.67   7.33  13.67 1978-04-01      4  1978    1  \n",
       "1978-05-01  11.79  12.87  27.16 1978-05-01      5  1978    1  \n",
       "1978-06-01   5.46   5.50  10.41 1978-06-01      6  1978    1  \n",
       "1978-07-01   8.04  14.04  16.17 1978-07-01      7  1978    1  \n",
       "1978-08-01   9.92  15.75  18.00 1978-08-01      8  1978    1  \n",
       "1978-09-01   6.50   7.62  15.96 1978-09-01      9  1978    1  \n",
       "1978-10-01   6.54  10.63  14.09 1978-10-01     10  1978    1  \n",
       "1978-11-01  11.25  23.13  25.00 1978-11-01     11  1978    1  \n",
       "1978-12-01  17.83  17.75  25.70 1978-12-01     12  1978    1  \n",
       "\n",
       "[216 rows x 16 columns]"
      ]
     },
     "execution_count": 429,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data.query('day == 1')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Step 14. Downsample the record to a weekly frequency for each location."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 430,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>RPT</th>\n",
       "      <th>VAL</th>\n",
       "      <th>ROS</th>\n",
       "      <th>KIL</th>\n",
       "      <th>SHA</th>\n",
       "      <th>BIR</th>\n",
       "      <th>DUB</th>\n",
       "      <th>CLA</th>\n",
       "      <th>MUL</th>\n",
       "      <th>CLO</th>\n",
       "      <th>BEL</th>\n",
       "      <th>MAL</th>\n",
       "      <th>date</th>\n",
       "      <th>month</th>\n",
       "      <th>year</th>\n",
       "      <th>day</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Yr_Mo_Dy</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>1961-01-01</th>\n",
       "      <td>15.04</td>\n",
       "      <td>14.96</td>\n",
       "      <td>13.17</td>\n",
       "      <td>9.29</td>\n",
       "      <td>NaN</td>\n",
       "      <td>9.87</td>\n",
       "      <td>13.67</td>\n",
       "      <td>10.25</td>\n",
       "      <td>10.83</td>\n",
       "      <td>12.58</td>\n",
       "      <td>18.50</td>\n",
       "      <td>15.04</td>\n",
       "      <td>1961-01-01</td>\n",
       "      <td>1</td>\n",
       "      <td>1961</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1961-01-08</th>\n",
       "      <td>10.96</td>\n",
       "      <td>9.75</td>\n",
       "      <td>7.62</td>\n",
       "      <td>5.91</td>\n",
       "      <td>9.62</td>\n",
       "      <td>7.29</td>\n",
       "      <td>14.29</td>\n",
       "      <td>7.62</td>\n",
       "      <td>9.25</td>\n",
       "      <td>10.46</td>\n",
       "      <td>16.62</td>\n",
       "      <td>16.46</td>\n",
       "      <td>1961-01-08</td>\n",
       "      <td>1</td>\n",
       "      <td>1961</td>\n",
       "      <td>8</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1961-01-15</th>\n",
       "      <td>12.04</td>\n",
       "      <td>9.67</td>\n",
       "      <td>11.75</td>\n",
       "      <td>2.37</td>\n",
       "      <td>7.38</td>\n",
       "      <td>3.13</td>\n",
       "      <td>2.50</td>\n",
       "      <td>6.83</td>\n",
       "      <td>4.75</td>\n",
       "      <td>5.63</td>\n",
       "      <td>7.54</td>\n",
       "      <td>6.75</td>\n",
       "      <td>1961-01-15</td>\n",
       "      <td>1</td>\n",
       "      <td>1961</td>\n",
       "      <td>15</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1961-01-22</th>\n",
       "      <td>9.59</td>\n",
       "      <td>5.88</td>\n",
       "      <td>9.92</td>\n",
       "      <td>2.17</td>\n",
       "      <td>6.87</td>\n",
       "      <td>5.50</td>\n",
       "      <td>9.38</td>\n",
       "      <td>7.04</td>\n",
       "      <td>6.34</td>\n",
       "      <td>7.50</td>\n",
       "      <td>10.88</td>\n",
       "      <td>9.92</td>\n",
       "      <td>1961-01-22</td>\n",
       "      <td>1</td>\n",
       "      <td>1961</td>\n",
       "      <td>22</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1961-01-29</th>\n",
       "      <td>NaN</td>\n",
       "      <td>23.91</td>\n",
       "      <td>22.29</td>\n",
       "      <td>17.54</td>\n",
       "      <td>24.08</td>\n",
       "      <td>19.70</td>\n",
       "      <td>22.00</td>\n",
       "      <td>20.25</td>\n",
       "      <td>21.46</td>\n",
       "      <td>19.95</td>\n",
       "      <td>27.71</td>\n",
       "      <td>23.38</td>\n",
       "      <td>1961-01-29</td>\n",
       "      <td>1</td>\n",
       "      <td>1961</td>\n",
       "      <td>29</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "              RPT    VAL    ROS    KIL    SHA    BIR    DUB    CLA    MUL  \\\n",
       "Yr_Mo_Dy                                                                    \n",
       "1961-01-01  15.04  14.96  13.17   9.29    NaN   9.87  13.67  10.25  10.83   \n",
       "1961-01-08  10.96   9.75   7.62   5.91   9.62   7.29  14.29   7.62   9.25   \n",
       "1961-01-15  12.04   9.67  11.75   2.37   7.38   3.13   2.50   6.83   4.75   \n",
       "1961-01-22   9.59   5.88   9.92   2.17   6.87   5.50   9.38   7.04   6.34   \n",
       "1961-01-29    NaN  23.91  22.29  17.54  24.08  19.70  22.00  20.25  21.46   \n",
       "\n",
       "              CLO    BEL    MAL       date  month  year  day  \n",
       "Yr_Mo_Dy                                                      \n",
       "1961-01-01  12.58  18.50  15.04 1961-01-01      1  1961    1  \n",
       "1961-01-08  10.46  16.62  16.46 1961-01-08      1  1961    8  \n",
       "1961-01-15   5.63   7.54   6.75 1961-01-15      1  1961   15  \n",
       "1961-01-22   7.50  10.88   9.92 1961-01-22      1  1961   22  \n",
       "1961-01-29  19.95  27.71  23.38 1961-01-29      1  1961   29  "
      ]
     },
     "execution_count": 430,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data[::7].head()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Step 15. Calculate the mean windspeed for each month in the dataset.  \n",
    "#### Treat January 1961 and January 1962 as *different* months.\n",
    "#### (hint: first find a  way to create an identifier unique for each month.)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Yr</th>\n",
       "      <th>Mo</th>\n",
       "      <th>Dy</th>\n",
       "      <th>RPT</th>\n",
       "      <th>VAL</th>\n",
       "      <th>ROS</th>\n",
       "      <th>KIL</th>\n",
       "      <th>SHA</th>\n",
       "      <th>BIR</th>\n",
       "      <th>DUB</th>\n",
       "      <th>CLA</th>\n",
       "      <th>MUL</th>\n",
       "      <th>CLO</th>\n",
       "      <th>BEL</th>\n",
       "      <th>MAL</th>\n",
       "      <th>months_num</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>61</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>15.04</td>\n",
       "      <td>14.96</td>\n",
       "      <td>13.17</td>\n",
       "      <td>9.29</td>\n",
       "      <td>NaN</td>\n",
       "      <td>9.87</td>\n",
       "      <td>13.67</td>\n",
       "      <td>10.25</td>\n",
       "      <td>10.83</td>\n",
       "      <td>12.58</td>\n",
       "      <td>18.50</td>\n",
       "      <td>15.04</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>61</td>\n",
       "      <td>1</td>\n",
       "      <td>2</td>\n",
       "      <td>14.71</td>\n",
       "      <td>NaN</td>\n",
       "      <td>10.83</td>\n",
       "      <td>6.50</td>\n",
       "      <td>12.62</td>\n",
       "      <td>7.67</td>\n",
       "      <td>11.50</td>\n",
       "      <td>10.04</td>\n",
       "      <td>9.79</td>\n",
       "      <td>9.67</td>\n",
       "      <td>17.54</td>\n",
       "      <td>13.83</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>61</td>\n",
       "      <td>1</td>\n",
       "      <td>3</td>\n",
       "      <td>18.50</td>\n",
       "      <td>16.88</td>\n",
       "      <td>12.33</td>\n",
       "      <td>10.13</td>\n",
       "      <td>11.17</td>\n",
       "      <td>6.17</td>\n",
       "      <td>11.25</td>\n",
       "      <td>NaN</td>\n",
       "      <td>8.50</td>\n",
       "      <td>7.67</td>\n",
       "      <td>12.75</td>\n",
       "      <td>12.71</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>61</td>\n",
       "      <td>1</td>\n",
       "      <td>4</td>\n",
       "      <td>10.58</td>\n",
       "      <td>6.63</td>\n",
       "      <td>11.75</td>\n",
       "      <td>4.58</td>\n",
       "      <td>4.54</td>\n",
       "      <td>2.88</td>\n",
       "      <td>8.63</td>\n",
       "      <td>1.79</td>\n",
       "      <td>5.83</td>\n",
       "      <td>5.88</td>\n",
       "      <td>5.46</td>\n",
       "      <td>10.88</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>61</td>\n",
       "      <td>1</td>\n",
       "      <td>5</td>\n",
       "      <td>13.33</td>\n",
       "      <td>13.25</td>\n",
       "      <td>11.42</td>\n",
       "      <td>6.17</td>\n",
       "      <td>10.71</td>\n",
       "      <td>8.21</td>\n",
       "      <td>11.92</td>\n",
       "      <td>6.54</td>\n",
       "      <td>10.92</td>\n",
       "      <td>10.34</td>\n",
       "      <td>12.92</td>\n",
       "      <td>11.83</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>61</td>\n",
       "      <td>1</td>\n",
       "      <td>6</td>\n",
       "      <td>13.21</td>\n",
       "      <td>8.12</td>\n",
       "      <td>9.96</td>\n",
       "      <td>6.67</td>\n",
       "      <td>5.37</td>\n",
       "      <td>4.50</td>\n",
       "      <td>10.67</td>\n",
       "      <td>4.42</td>\n",
       "      <td>7.17</td>\n",
       "      <td>7.50</td>\n",
       "      <td>8.12</td>\n",
       "      <td>13.17</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>61</td>\n",
       "      <td>1</td>\n",
       "      <td>7</td>\n",
       "      <td>13.50</td>\n",
       "      <td>14.29</td>\n",
       "      <td>9.50</td>\n",
       "      <td>4.96</td>\n",
       "      <td>12.29</td>\n",
       "      <td>8.33</td>\n",
       "      <td>9.17</td>\n",
       "      <td>9.29</td>\n",
       "      <td>7.58</td>\n",
       "      <td>7.96</td>\n",
       "      <td>13.96</td>\n",
       "      <td>13.79</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>61</td>\n",
       "      <td>1</td>\n",
       "      <td>8</td>\n",
       "      <td>10.96</td>\n",
       "      <td>9.75</td>\n",
       "      <td>7.62</td>\n",
       "      <td>5.91</td>\n",
       "      <td>9.62</td>\n",
       "      <td>7.29</td>\n",
       "      <td>14.29</td>\n",
       "      <td>7.62</td>\n",
       "      <td>9.25</td>\n",
       "      <td>10.46</td>\n",
       "      <td>16.62</td>\n",
       "      <td>16.46</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>61</td>\n",
       "      <td>1</td>\n",
       "      <td>9</td>\n",
       "      <td>12.58</td>\n",
       "      <td>10.83</td>\n",
       "      <td>10.00</td>\n",
       "      <td>4.75</td>\n",
       "      <td>10.37</td>\n",
       "      <td>6.79</td>\n",
       "      <td>8.04</td>\n",
       "      <td>10.13</td>\n",
       "      <td>7.79</td>\n",
       "      <td>9.08</td>\n",
       "      <td>13.04</td>\n",
       "      <td>15.37</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>61</td>\n",
       "      <td>1</td>\n",
       "      <td>10</td>\n",
       "      <td>13.37</td>\n",
       "      <td>11.12</td>\n",
       "      <td>19.50</td>\n",
       "      <td>8.33</td>\n",
       "      <td>9.71</td>\n",
       "      <td>6.54</td>\n",
       "      <td>11.42</td>\n",
       "      <td>7.79</td>\n",
       "      <td>8.54</td>\n",
       "      <td>9.00</td>\n",
       "      <td>8.58</td>\n",
       "      <td>11.83</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>61</td>\n",
       "      <td>1</td>\n",
       "      <td>11</td>\n",
       "      <td>10.58</td>\n",
       "      <td>9.87</td>\n",
       "      <td>8.42</td>\n",
       "      <td>2.79</td>\n",
       "      <td>8.71</td>\n",
       "      <td>7.25</td>\n",
       "      <td>7.54</td>\n",
       "      <td>8.33</td>\n",
       "      <td>5.71</td>\n",
       "      <td>8.67</td>\n",
       "      <td>20.71</td>\n",
       "      <td>16.92</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>61</td>\n",
       "      <td>1</td>\n",
       "      <td>12</td>\n",
       "      <td>19.75</td>\n",
       "      <td>12.08</td>\n",
       "      <td>18.50</td>\n",
       "      <td>10.54</td>\n",
       "      <td>10.29</td>\n",
       "      <td>9.46</td>\n",
       "      <td>15.54</td>\n",
       "      <td>11.50</td>\n",
       "      <td>10.37</td>\n",
       "      <td>14.58</td>\n",
       "      <td>15.59</td>\n",
       "      <td>14.09</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>61</td>\n",
       "      <td>1</td>\n",
       "      <td>13</td>\n",
       "      <td>9.92</td>\n",
       "      <td>3.54</td>\n",
       "      <td>8.46</td>\n",
       "      <td>2.96</td>\n",
       "      <td>2.29</td>\n",
       "      <td>0.96</td>\n",
       "      <td>4.63</td>\n",
       "      <td>0.58</td>\n",
       "      <td>2.33</td>\n",
       "      <td>3.37</td>\n",
       "      <td>5.25</td>\n",
       "      <td>7.04</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>61</td>\n",
       "      <td>1</td>\n",
       "      <td>14</td>\n",
       "      <td>9.04</td>\n",
       "      <td>5.66</td>\n",
       "      <td>7.08</td>\n",
       "      <td>0.67</td>\n",
       "      <td>2.71</td>\n",
       "      <td>1.38</td>\n",
       "      <td>3.08</td>\n",
       "      <td>2.58</td>\n",
       "      <td>0.50</td>\n",
       "      <td>2.67</td>\n",
       "      <td>7.17</td>\n",
       "      <td>5.17</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>14</th>\n",
       "      <td>61</td>\n",
       "      <td>1</td>\n",
       "      <td>15</td>\n",
       "      <td>12.04</td>\n",
       "      <td>9.67</td>\n",
       "      <td>11.75</td>\n",
       "      <td>2.37</td>\n",
       "      <td>7.38</td>\n",
       "      <td>3.13</td>\n",
       "      <td>2.50</td>\n",
       "      <td>6.83</td>\n",
       "      <td>4.75</td>\n",
       "      <td>5.63</td>\n",
       "      <td>7.54</td>\n",
       "      <td>6.75</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15</th>\n",
       "      <td>61</td>\n",
       "      <td>1</td>\n",
       "      <td>16</td>\n",
       "      <td>16.42</td>\n",
       "      <td>11.25</td>\n",
       "      <td>15.67</td>\n",
       "      <td>4.71</td>\n",
       "      <td>11.34</td>\n",
       "      <td>6.92</td>\n",
       "      <td>9.25</td>\n",
       "      <td>8.79</td>\n",
       "      <td>8.21</td>\n",
       "      <td>7.33</td>\n",
       "      <td>13.04</td>\n",
       "      <td>9.04</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>16</th>\n",
       "      <td>61</td>\n",
       "      <td>1</td>\n",
       "      <td>17</td>\n",
       "      <td>17.75</td>\n",
       "      <td>14.37</td>\n",
       "      <td>17.33</td>\n",
       "      <td>10.13</td>\n",
       "      <td>13.96</td>\n",
       "      <td>13.37</td>\n",
       "      <td>13.42</td>\n",
       "      <td>11.04</td>\n",
       "      <td>8.71</td>\n",
       "      <td>11.38</td>\n",
       "      <td>15.92</td>\n",
       "      <td>16.08</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>17</th>\n",
       "      <td>61</td>\n",
       "      <td>1</td>\n",
       "      <td>18</td>\n",
       "      <td>19.83</td>\n",
       "      <td>12.04</td>\n",
       "      <td>20.79</td>\n",
       "      <td>18.54</td>\n",
       "      <td>NaN</td>\n",
       "      <td>10.29</td>\n",
       "      <td>17.83</td>\n",
       "      <td>11.38</td>\n",
       "      <td>14.67</td>\n",
       "      <td>16.71</td>\n",
       "      <td>8.79</td>\n",
       "      <td>17.96</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>18</th>\n",
       "      <td>61</td>\n",
       "      <td>1</td>\n",
       "      <td>19</td>\n",
       "      <td>4.92</td>\n",
       "      <td>3.42</td>\n",
       "      <td>7.29</td>\n",
       "      <td>1.04</td>\n",
       "      <td>3.67</td>\n",
       "      <td>3.17</td>\n",
       "      <td>3.71</td>\n",
       "      <td>2.79</td>\n",
       "      <td>1.92</td>\n",
       "      <td>2.71</td>\n",
       "      <td>6.87</td>\n",
       "      <td>7.83</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>19</th>\n",
       "      <td>61</td>\n",
       "      <td>1</td>\n",
       "      <td>20</td>\n",
       "      <td>9.59</td>\n",
       "      <td>11.83</td>\n",
       "      <td>7.96</td>\n",
       "      <td>1.58</td>\n",
       "      <td>7.92</td>\n",
       "      <td>5.00</td>\n",
       "      <td>3.17</td>\n",
       "      <td>4.92</td>\n",
       "      <td>3.13</td>\n",
       "      <td>3.37</td>\n",
       "      <td>6.50</td>\n",
       "      <td>6.79</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20</th>\n",
       "      <td>61</td>\n",
       "      <td>1</td>\n",
       "      <td>21</td>\n",
       "      <td>14.33</td>\n",
       "      <td>10.25</td>\n",
       "      <td>11.92</td>\n",
       "      <td>6.13</td>\n",
       "      <td>10.04</td>\n",
       "      <td>7.67</td>\n",
       "      <td>8.04</td>\n",
       "      <td>9.17</td>\n",
       "      <td>7.04</td>\n",
       "      <td>7.87</td>\n",
       "      <td>6.75</td>\n",
       "      <td>12.42</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>21</th>\n",
       "      <td>61</td>\n",
       "      <td>1</td>\n",
       "      <td>22</td>\n",
       "      <td>9.59</td>\n",
       "      <td>5.88</td>\n",
       "      <td>9.92</td>\n",
       "      <td>2.17</td>\n",
       "      <td>6.87</td>\n",
       "      <td>5.50</td>\n",
       "      <td>9.38</td>\n",
       "      <td>7.04</td>\n",
       "      <td>6.34</td>\n",
       "      <td>7.50</td>\n",
       "      <td>10.88</td>\n",
       "      <td>9.92</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>22</th>\n",
       "      <td>61</td>\n",
       "      <td>1</td>\n",
       "      <td>23</td>\n",
       "      <td>16.54</td>\n",
       "      <td>9.96</td>\n",
       "      <td>18.54</td>\n",
       "      <td>10.46</td>\n",
       "      <td>13.50</td>\n",
       "      <td>12.67</td>\n",
       "      <td>13.70</td>\n",
       "      <td>13.75</td>\n",
       "      <td>10.75</td>\n",
       "      <td>13.17</td>\n",
       "      <td>14.79</td>\n",
       "      <td>20.58</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>23</th>\n",
       "      <td>61</td>\n",
       "      <td>1</td>\n",
       "      <td>24</td>\n",
       "      <td>25.04</td>\n",
       "      <td>14.83</td>\n",
       "      <td>25.84</td>\n",
       "      <td>15.67</td>\n",
       "      <td>21.46</td>\n",
       "      <td>18.58</td>\n",
       "      <td>20.38</td>\n",
       "      <td>19.38</td>\n",
       "      <td>15.37</td>\n",
       "      <td>15.12</td>\n",
       "      <td>23.09</td>\n",
       "      <td>25.25</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>24</th>\n",
       "      <td>61</td>\n",
       "      <td>1</td>\n",
       "      <td>25</td>\n",
       "      <td>13.62</td>\n",
       "      <td>11.17</td>\n",
       "      <td>12.67</td>\n",
       "      <td>6.04</td>\n",
       "      <td>10.00</td>\n",
       "      <td>9.42</td>\n",
       "      <td>9.25</td>\n",
       "      <td>8.71</td>\n",
       "      <td>7.12</td>\n",
       "      <td>12.04</td>\n",
       "      <td>14.04</td>\n",
       "      <td>17.50</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>25</th>\n",
       "      <td>61</td>\n",
       "      <td>1</td>\n",
       "      <td>26</td>\n",
       "      <td>24.37</td>\n",
       "      <td>18.79</td>\n",
       "      <td>17.50</td>\n",
       "      <td>14.25</td>\n",
       "      <td>18.91</td>\n",
       "      <td>15.67</td>\n",
       "      <td>14.33</td>\n",
       "      <td>15.16</td>\n",
       "      <td>16.08</td>\n",
       "      <td>19.08</td>\n",
       "      <td>20.50</td>\n",
       "      <td>25.25</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>26</th>\n",
       "      <td>61</td>\n",
       "      <td>1</td>\n",
       "      <td>27</td>\n",
       "      <td>22.04</td>\n",
       "      <td>20.79</td>\n",
       "      <td>17.41</td>\n",
       "      <td>16.21</td>\n",
       "      <td>19.04</td>\n",
       "      <td>16.13</td>\n",
       "      <td>16.79</td>\n",
       "      <td>18.29</td>\n",
       "      <td>18.66</td>\n",
       "      <td>19.08</td>\n",
       "      <td>26.08</td>\n",
       "      <td>27.63</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>27</th>\n",
       "      <td>61</td>\n",
       "      <td>1</td>\n",
       "      <td>28</td>\n",
       "      <td>17.67</td>\n",
       "      <td>13.54</td>\n",
       "      <td>13.33</td>\n",
       "      <td>8.87</td>\n",
       "      <td>15.04</td>\n",
       "      <td>11.63</td>\n",
       "      <td>12.25</td>\n",
       "      <td>10.58</td>\n",
       "      <td>11.92</td>\n",
       "      <td>11.04</td>\n",
       "      <td>20.30</td>\n",
       "      <td>18.12</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>28</th>\n",
       "      <td>61</td>\n",
       "      <td>1</td>\n",
       "      <td>29</td>\n",
       "      <td>NaN</td>\n",
       "      <td>23.91</td>\n",
       "      <td>22.29</td>\n",
       "      <td>17.54</td>\n",
       "      <td>24.08</td>\n",
       "      <td>19.70</td>\n",
       "      <td>22.00</td>\n",
       "      <td>20.25</td>\n",
       "      <td>21.46</td>\n",
       "      <td>19.95</td>\n",
       "      <td>27.71</td>\n",
       "      <td>23.38</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>29</th>\n",
       "      <td>61</td>\n",
       "      <td>1</td>\n",
       "      <td>30</td>\n",
       "      <td>12.21</td>\n",
       "      <td>11.42</td>\n",
       "      <td>10.92</td>\n",
       "      <td>7.92</td>\n",
       "      <td>13.08</td>\n",
       "      <td>9.62</td>\n",
       "      <td>14.50</td>\n",
       "      <td>10.21</td>\n",
       "      <td>9.92</td>\n",
       "      <td>11.96</td>\n",
       "      <td>18.88</td>\n",
       "      <td>19.25</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6544</th>\n",
       "      <td>78</td>\n",
       "      <td>12</td>\n",
       "      <td>2</td>\n",
       "      <td>13.70</td>\n",
       "      <td>12.71</td>\n",
       "      <td>14.29</td>\n",
       "      <td>5.13</td>\n",
       "      <td>9.21</td>\n",
       "      <td>8.04</td>\n",
       "      <td>12.33</td>\n",
       "      <td>6.34</td>\n",
       "      <td>9.21</td>\n",
       "      <td>11.21</td>\n",
       "      <td>9.59</td>\n",
       "      <td>19.95</td>\n",
       "      <td>216</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6545</th>\n",
       "      <td>78</td>\n",
       "      <td>12</td>\n",
       "      <td>3</td>\n",
       "      <td>21.21</td>\n",
       "      <td>21.34</td>\n",
       "      <td>17.75</td>\n",
       "      <td>11.58</td>\n",
       "      <td>16.75</td>\n",
       "      <td>14.46</td>\n",
       "      <td>17.46</td>\n",
       "      <td>15.29</td>\n",
       "      <td>15.79</td>\n",
       "      <td>17.50</td>\n",
       "      <td>21.42</td>\n",
       "      <td>25.75</td>\n",
       "      <td>216</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6546</th>\n",
       "      <td>78</td>\n",
       "      <td>12</td>\n",
       "      <td>4</td>\n",
       "      <td>9.92</td>\n",
       "      <td>13.50</td>\n",
       "      <td>7.21</td>\n",
       "      <td>1.71</td>\n",
       "      <td>11.00</td>\n",
       "      <td>7.50</td>\n",
       "      <td>8.38</td>\n",
       "      <td>7.46</td>\n",
       "      <td>10.79</td>\n",
       "      <td>10.21</td>\n",
       "      <td>17.88</td>\n",
       "      <td>17.96</td>\n",
       "      <td>216</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6547</th>\n",
       "      <td>78</td>\n",
       "      <td>12</td>\n",
       "      <td>5</td>\n",
       "      <td>22.75</td>\n",
       "      <td>20.17</td>\n",
       "      <td>18.58</td>\n",
       "      <td>8.50</td>\n",
       "      <td>15.96</td>\n",
       "      <td>14.29</td>\n",
       "      <td>13.92</td>\n",
       "      <td>12.92</td>\n",
       "      <td>12.96</td>\n",
       "      <td>12.29</td>\n",
       "      <td>17.08</td>\n",
       "      <td>19.83</td>\n",
       "      <td>216</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6548</th>\n",
       "      <td>78</td>\n",
       "      <td>12</td>\n",
       "      <td>6</td>\n",
       "      <td>29.33</td>\n",
       "      <td>23.87</td>\n",
       "      <td>25.37</td>\n",
       "      <td>16.04</td>\n",
       "      <td>24.46</td>\n",
       "      <td>19.50</td>\n",
       "      <td>24.54</td>\n",
       "      <td>18.58</td>\n",
       "      <td>21.00</td>\n",
       "      <td>20.58</td>\n",
       "      <td>21.67</td>\n",
       "      <td>34.46</td>\n",
       "      <td>216</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6549</th>\n",
       "      <td>78</td>\n",
       "      <td>12</td>\n",
       "      <td>7</td>\n",
       "      <td>26.63</td>\n",
       "      <td>24.79</td>\n",
       "      <td>24.79</td>\n",
       "      <td>18.16</td>\n",
       "      <td>23.13</td>\n",
       "      <td>19.58</td>\n",
       "      <td>19.92</td>\n",
       "      <td>19.04</td>\n",
       "      <td>19.75</td>\n",
       "      <td>21.50</td>\n",
       "      <td>23.04</td>\n",
       "      <td>34.59</td>\n",
       "      <td>216</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6550</th>\n",
       "      <td>78</td>\n",
       "      <td>12</td>\n",
       "      <td>8</td>\n",
       "      <td>12.92</td>\n",
       "      <td>12.54</td>\n",
       "      <td>11.25</td>\n",
       "      <td>3.37</td>\n",
       "      <td>6.50</td>\n",
       "      <td>5.96</td>\n",
       "      <td>10.34</td>\n",
       "      <td>6.17</td>\n",
       "      <td>6.63</td>\n",
       "      <td>6.75</td>\n",
       "      <td>9.54</td>\n",
       "      <td>17.33</td>\n",
       "      <td>216</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6551</th>\n",
       "      <td>78</td>\n",
       "      <td>12</td>\n",
       "      <td>9</td>\n",
       "      <td>18.71</td>\n",
       "      <td>16.92</td>\n",
       "      <td>15.50</td>\n",
       "      <td>6.04</td>\n",
       "      <td>10.37</td>\n",
       "      <td>9.59</td>\n",
       "      <td>10.75</td>\n",
       "      <td>9.13</td>\n",
       "      <td>9.75</td>\n",
       "      <td>11.08</td>\n",
       "      <td>14.33</td>\n",
       "      <td>15.34</td>\n",
       "      <td>216</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6552</th>\n",
       "      <td>78</td>\n",
       "      <td>12</td>\n",
       "      <td>10</td>\n",
       "      <td>24.92</td>\n",
       "      <td>22.54</td>\n",
       "      <td>16.54</td>\n",
       "      <td>14.62</td>\n",
       "      <td>15.59</td>\n",
       "      <td>13.00</td>\n",
       "      <td>13.21</td>\n",
       "      <td>14.12</td>\n",
       "      <td>16.21</td>\n",
       "      <td>16.17</td>\n",
       "      <td>26.08</td>\n",
       "      <td>21.92</td>\n",
       "      <td>216</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6553</th>\n",
       "      <td>78</td>\n",
       "      <td>12</td>\n",
       "      <td>11</td>\n",
       "      <td>20.25</td>\n",
       "      <td>19.17</td>\n",
       "      <td>17.83</td>\n",
       "      <td>11.63</td>\n",
       "      <td>17.79</td>\n",
       "      <td>13.37</td>\n",
       "      <td>14.83</td>\n",
       "      <td>13.88</td>\n",
       "      <td>15.54</td>\n",
       "      <td>16.29</td>\n",
       "      <td>18.34</td>\n",
       "      <td>22.83</td>\n",
       "      <td>216</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6554</th>\n",
       "      <td>78</td>\n",
       "      <td>12</td>\n",
       "      <td>12</td>\n",
       "      <td>23.13</td>\n",
       "      <td>18.63</td>\n",
       "      <td>18.05</td>\n",
       "      <td>8.29</td>\n",
       "      <td>14.33</td>\n",
       "      <td>11.04</td>\n",
       "      <td>10.54</td>\n",
       "      <td>10.13</td>\n",
       "      <td>11.42</td>\n",
       "      <td>10.50</td>\n",
       "      <td>11.25</td>\n",
       "      <td>13.50</td>\n",
       "      <td>216</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6555</th>\n",
       "      <td>78</td>\n",
       "      <td>12</td>\n",
       "      <td>13</td>\n",
       "      <td>18.84</td>\n",
       "      <td>24.04</td>\n",
       "      <td>14.37</td>\n",
       "      <td>8.33</td>\n",
       "      <td>18.12</td>\n",
       "      <td>12.17</td>\n",
       "      <td>13.00</td>\n",
       "      <td>13.75</td>\n",
       "      <td>14.17</td>\n",
       "      <td>15.09</td>\n",
       "      <td>21.50</td>\n",
       "      <td>21.37</td>\n",
       "      <td>216</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6556</th>\n",
       "      <td>78</td>\n",
       "      <td>12</td>\n",
       "      <td>14</td>\n",
       "      <td>17.21</td>\n",
       "      <td>19.75</td>\n",
       "      <td>12.71</td>\n",
       "      <td>5.83</td>\n",
       "      <td>13.79</td>\n",
       "      <td>7.33</td>\n",
       "      <td>8.83</td>\n",
       "      <td>5.71</td>\n",
       "      <td>7.96</td>\n",
       "      <td>3.37</td>\n",
       "      <td>5.21</td>\n",
       "      <td>6.92</td>\n",
       "      <td>216</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6557</th>\n",
       "      <td>78</td>\n",
       "      <td>12</td>\n",
       "      <td>15</td>\n",
       "      <td>13.13</td>\n",
       "      <td>8.92</td>\n",
       "      <td>16.54</td>\n",
       "      <td>6.92</td>\n",
       "      <td>6.00</td>\n",
       "      <td>4.00</td>\n",
       "      <td>12.67</td>\n",
       "      <td>5.88</td>\n",
       "      <td>7.67</td>\n",
       "      <td>6.08</td>\n",
       "      <td>5.50</td>\n",
       "      <td>17.16</td>\n",
       "      <td>216</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6558</th>\n",
       "      <td>78</td>\n",
       "      <td>12</td>\n",
       "      <td>16</td>\n",
       "      <td>14.88</td>\n",
       "      <td>9.13</td>\n",
       "      <td>17.37</td>\n",
       "      <td>5.21</td>\n",
       "      <td>6.71</td>\n",
       "      <td>2.46</td>\n",
       "      <td>9.13</td>\n",
       "      <td>4.96</td>\n",
       "      <td>6.13</td>\n",
       "      <td>5.96</td>\n",
       "      <td>10.92</td>\n",
       "      <td>18.08</td>\n",
       "      <td>216</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6559</th>\n",
       "      <td>78</td>\n",
       "      <td>12</td>\n",
       "      <td>17</td>\n",
       "      <td>9.87</td>\n",
       "      <td>3.21</td>\n",
       "      <td>8.04</td>\n",
       "      <td>2.21</td>\n",
       "      <td>3.04</td>\n",
       "      <td>0.54</td>\n",
       "      <td>2.46</td>\n",
       "      <td>1.46</td>\n",
       "      <td>1.29</td>\n",
       "      <td>2.67</td>\n",
       "      <td>5.00</td>\n",
       "      <td>9.08</td>\n",
       "      <td>216</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6560</th>\n",
       "      <td>78</td>\n",
       "      <td>12</td>\n",
       "      <td>18</td>\n",
       "      <td>9.83</td>\n",
       "      <td>10.88</td>\n",
       "      <td>8.50</td>\n",
       "      <td>1.00</td>\n",
       "      <td>9.08</td>\n",
       "      <td>6.00</td>\n",
       "      <td>2.42</td>\n",
       "      <td>8.25</td>\n",
       "      <td>4.42</td>\n",
       "      <td>5.88</td>\n",
       "      <td>19.79</td>\n",
       "      <td>19.79</td>\n",
       "      <td>216</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6561</th>\n",
       "      <td>78</td>\n",
       "      <td>12</td>\n",
       "      <td>19</td>\n",
       "      <td>13.88</td>\n",
       "      <td>11.42</td>\n",
       "      <td>10.13</td>\n",
       "      <td>2.33</td>\n",
       "      <td>8.12</td>\n",
       "      <td>6.75</td>\n",
       "      <td>4.75</td>\n",
       "      <td>5.88</td>\n",
       "      <td>6.21</td>\n",
       "      <td>8.17</td>\n",
       "      <td>8.33</td>\n",
       "      <td>18.25</td>\n",
       "      <td>216</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6562</th>\n",
       "      <td>78</td>\n",
       "      <td>12</td>\n",
       "      <td>20</td>\n",
       "      <td>9.92</td>\n",
       "      <td>3.63</td>\n",
       "      <td>12.38</td>\n",
       "      <td>3.08</td>\n",
       "      <td>3.50</td>\n",
       "      <td>0.42</td>\n",
       "      <td>4.54</td>\n",
       "      <td>2.50</td>\n",
       "      <td>2.13</td>\n",
       "      <td>4.71</td>\n",
       "      <td>3.21</td>\n",
       "      <td>10.29</td>\n",
       "      <td>216</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6563</th>\n",
       "      <td>78</td>\n",
       "      <td>12</td>\n",
       "      <td>21</td>\n",
       "      <td>12.96</td>\n",
       "      <td>3.83</td>\n",
       "      <td>13.79</td>\n",
       "      <td>4.79</td>\n",
       "      <td>7.12</td>\n",
       "      <td>6.54</td>\n",
       "      <td>11.67</td>\n",
       "      <td>9.25</td>\n",
       "      <td>8.67</td>\n",
       "      <td>9.00</td>\n",
       "      <td>11.25</td>\n",
       "      <td>20.30</td>\n",
       "      <td>216</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6564</th>\n",
       "      <td>78</td>\n",
       "      <td>12</td>\n",
       "      <td>22</td>\n",
       "      <td>6.21</td>\n",
       "      <td>7.38</td>\n",
       "      <td>13.08</td>\n",
       "      <td>2.54</td>\n",
       "      <td>7.58</td>\n",
       "      <td>5.33</td>\n",
       "      <td>2.46</td>\n",
       "      <td>8.38</td>\n",
       "      <td>5.09</td>\n",
       "      <td>5.04</td>\n",
       "      <td>9.92</td>\n",
       "      <td>11.00</td>\n",
       "      <td>216</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6565</th>\n",
       "      <td>78</td>\n",
       "      <td>12</td>\n",
       "      <td>23</td>\n",
       "      <td>16.62</td>\n",
       "      <td>13.29</td>\n",
       "      <td>22.21</td>\n",
       "      <td>9.50</td>\n",
       "      <td>14.29</td>\n",
       "      <td>13.08</td>\n",
       "      <td>16.50</td>\n",
       "      <td>17.16</td>\n",
       "      <td>12.71</td>\n",
       "      <td>12.00</td>\n",
       "      <td>18.50</td>\n",
       "      <td>21.50</td>\n",
       "      <td>216</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6566</th>\n",
       "      <td>78</td>\n",
       "      <td>12</td>\n",
       "      <td>24</td>\n",
       "      <td>8.67</td>\n",
       "      <td>5.63</td>\n",
       "      <td>12.12</td>\n",
       "      <td>4.79</td>\n",
       "      <td>5.09</td>\n",
       "      <td>5.91</td>\n",
       "      <td>12.25</td>\n",
       "      <td>9.25</td>\n",
       "      <td>10.83</td>\n",
       "      <td>11.71</td>\n",
       "      <td>11.92</td>\n",
       "      <td>31.71</td>\n",
       "      <td>216</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6567</th>\n",
       "      <td>78</td>\n",
       "      <td>12</td>\n",
       "      <td>25</td>\n",
       "      <td>7.21</td>\n",
       "      <td>6.58</td>\n",
       "      <td>7.83</td>\n",
       "      <td>2.67</td>\n",
       "      <td>4.79</td>\n",
       "      <td>4.58</td>\n",
       "      <td>8.71</td>\n",
       "      <td>0.75</td>\n",
       "      <td>5.21</td>\n",
       "      <td>5.25</td>\n",
       "      <td>1.21</td>\n",
       "      <td>13.96</td>\n",
       "      <td>216</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6568</th>\n",
       "      <td>78</td>\n",
       "      <td>12</td>\n",
       "      <td>26</td>\n",
       "      <td>13.83</td>\n",
       "      <td>11.87</td>\n",
       "      <td>10.34</td>\n",
       "      <td>2.37</td>\n",
       "      <td>6.96</td>\n",
       "      <td>4.29</td>\n",
       "      <td>1.96</td>\n",
       "      <td>3.79</td>\n",
       "      <td>3.04</td>\n",
       "      <td>3.08</td>\n",
       "      <td>4.79</td>\n",
       "      <td>11.96</td>\n",
       "      <td>216</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6569</th>\n",
       "      <td>78</td>\n",
       "      <td>12</td>\n",
       "      <td>27</td>\n",
       "      <td>17.58</td>\n",
       "      <td>16.96</td>\n",
       "      <td>17.62</td>\n",
       "      <td>8.08</td>\n",
       "      <td>13.21</td>\n",
       "      <td>11.67</td>\n",
       "      <td>14.46</td>\n",
       "      <td>15.59</td>\n",
       "      <td>14.04</td>\n",
       "      <td>14.00</td>\n",
       "      <td>17.21</td>\n",
       "      <td>40.08</td>\n",
       "      <td>216</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6570</th>\n",
       "      <td>78</td>\n",
       "      <td>12</td>\n",
       "      <td>28</td>\n",
       "      <td>13.21</td>\n",
       "      <td>5.46</td>\n",
       "      <td>13.46</td>\n",
       "      <td>5.00</td>\n",
       "      <td>8.12</td>\n",
       "      <td>9.42</td>\n",
       "      <td>14.33</td>\n",
       "      <td>16.25</td>\n",
       "      <td>15.25</td>\n",
       "      <td>18.05</td>\n",
       "      <td>21.79</td>\n",
       "      <td>41.46</td>\n",
       "      <td>216</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6571</th>\n",
       "      <td>78</td>\n",
       "      <td>12</td>\n",
       "      <td>29</td>\n",
       "      <td>14.00</td>\n",
       "      <td>10.29</td>\n",
       "      <td>14.42</td>\n",
       "      <td>8.71</td>\n",
       "      <td>9.71</td>\n",
       "      <td>10.54</td>\n",
       "      <td>19.17</td>\n",
       "      <td>12.46</td>\n",
       "      <td>14.50</td>\n",
       "      <td>16.42</td>\n",
       "      <td>18.88</td>\n",
       "      <td>29.58</td>\n",
       "      <td>216</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6572</th>\n",
       "      <td>78</td>\n",
       "      <td>12</td>\n",
       "      <td>30</td>\n",
       "      <td>18.50</td>\n",
       "      <td>14.04</td>\n",
       "      <td>21.29</td>\n",
       "      <td>9.13</td>\n",
       "      <td>12.75</td>\n",
       "      <td>9.71</td>\n",
       "      <td>18.08</td>\n",
       "      <td>12.87</td>\n",
       "      <td>12.46</td>\n",
       "      <td>12.12</td>\n",
       "      <td>14.67</td>\n",
       "      <td>28.79</td>\n",
       "      <td>216</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6573</th>\n",
       "      <td>78</td>\n",
       "      <td>12</td>\n",
       "      <td>31</td>\n",
       "      <td>20.33</td>\n",
       "      <td>17.41</td>\n",
       "      <td>27.29</td>\n",
       "      <td>9.59</td>\n",
       "      <td>12.08</td>\n",
       "      <td>10.13</td>\n",
       "      <td>19.25</td>\n",
       "      <td>11.63</td>\n",
       "      <td>11.58</td>\n",
       "      <td>11.38</td>\n",
       "      <td>12.08</td>\n",
       "      <td>22.08</td>\n",
       "      <td>216</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>6574 rows × 16 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "      Yr  Mo  Dy    RPT    VAL    ROS    KIL    SHA    BIR    DUB    CLA  \\\n",
       "0     61   1   1  15.04  14.96  13.17   9.29    NaN   9.87  13.67  10.25   \n",
       "1     61   1   2  14.71    NaN  10.83   6.50  12.62   7.67  11.50  10.04   \n",
       "2     61   1   3  18.50  16.88  12.33  10.13  11.17   6.17  11.25    NaN   \n",
       "3     61   1   4  10.58   6.63  11.75   4.58   4.54   2.88   8.63   1.79   \n",
       "4     61   1   5  13.33  13.25  11.42   6.17  10.71   8.21  11.92   6.54   \n",
       "5     61   1   6  13.21   8.12   9.96   6.67   5.37   4.50  10.67   4.42   \n",
       "6     61   1   7  13.50  14.29   9.50   4.96  12.29   8.33   9.17   9.29   \n",
       "7     61   1   8  10.96   9.75   7.62   5.91   9.62   7.29  14.29   7.62   \n",
       "8     61   1   9  12.58  10.83  10.00   4.75  10.37   6.79   8.04  10.13   \n",
       "9     61   1  10  13.37  11.12  19.50   8.33   9.71   6.54  11.42   7.79   \n",
       "10    61   1  11  10.58   9.87   8.42   2.79   8.71   7.25   7.54   8.33   \n",
       "11    61   1  12  19.75  12.08  18.50  10.54  10.29   9.46  15.54  11.50   \n",
       "12    61   1  13   9.92   3.54   8.46   2.96   2.29   0.96   4.63   0.58   \n",
       "13    61   1  14   9.04   5.66   7.08   0.67   2.71   1.38   3.08   2.58   \n",
       "14    61   1  15  12.04   9.67  11.75   2.37   7.38   3.13   2.50   6.83   \n",
       "15    61   1  16  16.42  11.25  15.67   4.71  11.34   6.92   9.25   8.79   \n",
       "16    61   1  17  17.75  14.37  17.33  10.13  13.96  13.37  13.42  11.04   \n",
       "17    61   1  18  19.83  12.04  20.79  18.54    NaN  10.29  17.83  11.38   \n",
       "18    61   1  19   4.92   3.42   7.29   1.04   3.67   3.17   3.71   2.79   \n",
       "19    61   1  20   9.59  11.83   7.96   1.58   7.92   5.00   3.17   4.92   \n",
       "20    61   1  21  14.33  10.25  11.92   6.13  10.04   7.67   8.04   9.17   \n",
       "21    61   1  22   9.59   5.88   9.92   2.17   6.87   5.50   9.38   7.04   \n",
       "22    61   1  23  16.54   9.96  18.54  10.46  13.50  12.67  13.70  13.75   \n",
       "23    61   1  24  25.04  14.83  25.84  15.67  21.46  18.58  20.38  19.38   \n",
       "24    61   1  25  13.62  11.17  12.67   6.04  10.00   9.42   9.25   8.71   \n",
       "25    61   1  26  24.37  18.79  17.50  14.25  18.91  15.67  14.33  15.16   \n",
       "26    61   1  27  22.04  20.79  17.41  16.21  19.04  16.13  16.79  18.29   \n",
       "27    61   1  28  17.67  13.54  13.33   8.87  15.04  11.63  12.25  10.58   \n",
       "28    61   1  29    NaN  23.91  22.29  17.54  24.08  19.70  22.00  20.25   \n",
       "29    61   1  30  12.21  11.42  10.92   7.92  13.08   9.62  14.50  10.21   \n",
       "...   ..  ..  ..    ...    ...    ...    ...    ...    ...    ...    ...   \n",
       "6544  78  12   2  13.70  12.71  14.29   5.13   9.21   8.04  12.33   6.34   \n",
       "6545  78  12   3  21.21  21.34  17.75  11.58  16.75  14.46  17.46  15.29   \n",
       "6546  78  12   4   9.92  13.50   7.21   1.71  11.00   7.50   8.38   7.46   \n",
       "6547  78  12   5  22.75  20.17  18.58   8.50  15.96  14.29  13.92  12.92   \n",
       "6548  78  12   6  29.33  23.87  25.37  16.04  24.46  19.50  24.54  18.58   \n",
       "6549  78  12   7  26.63  24.79  24.79  18.16  23.13  19.58  19.92  19.04   \n",
       "6550  78  12   8  12.92  12.54  11.25   3.37   6.50   5.96  10.34   6.17   \n",
       "6551  78  12   9  18.71  16.92  15.50   6.04  10.37   9.59  10.75   9.13   \n",
       "6552  78  12  10  24.92  22.54  16.54  14.62  15.59  13.00  13.21  14.12   \n",
       "6553  78  12  11  20.25  19.17  17.83  11.63  17.79  13.37  14.83  13.88   \n",
       "6554  78  12  12  23.13  18.63  18.05   8.29  14.33  11.04  10.54  10.13   \n",
       "6555  78  12  13  18.84  24.04  14.37   8.33  18.12  12.17  13.00  13.75   \n",
       "6556  78  12  14  17.21  19.75  12.71   5.83  13.79   7.33   8.83   5.71   \n",
       "6557  78  12  15  13.13   8.92  16.54   6.92   6.00   4.00  12.67   5.88   \n",
       "6558  78  12  16  14.88   9.13  17.37   5.21   6.71   2.46   9.13   4.96   \n",
       "6559  78  12  17   9.87   3.21   8.04   2.21   3.04   0.54   2.46   1.46   \n",
       "6560  78  12  18   9.83  10.88   8.50   1.00   9.08   6.00   2.42   8.25   \n",
       "6561  78  12  19  13.88  11.42  10.13   2.33   8.12   6.75   4.75   5.88   \n",
       "6562  78  12  20   9.92   3.63  12.38   3.08   3.50   0.42   4.54   2.50   \n",
       "6563  78  12  21  12.96   3.83  13.79   4.79   7.12   6.54  11.67   9.25   \n",
       "6564  78  12  22   6.21   7.38  13.08   2.54   7.58   5.33   2.46   8.38   \n",
       "6565  78  12  23  16.62  13.29  22.21   9.50  14.29  13.08  16.50  17.16   \n",
       "6566  78  12  24   8.67   5.63  12.12   4.79   5.09   5.91  12.25   9.25   \n",
       "6567  78  12  25   7.21   6.58   7.83   2.67   4.79   4.58   8.71   0.75   \n",
       "6568  78  12  26  13.83  11.87  10.34   2.37   6.96   4.29   1.96   3.79   \n",
       "6569  78  12  27  17.58  16.96  17.62   8.08  13.21  11.67  14.46  15.59   \n",
       "6570  78  12  28  13.21   5.46  13.46   5.00   8.12   9.42  14.33  16.25   \n",
       "6571  78  12  29  14.00  10.29  14.42   8.71   9.71  10.54  19.17  12.46   \n",
       "6572  78  12  30  18.50  14.04  21.29   9.13  12.75   9.71  18.08  12.87   \n",
       "6573  78  12  31  20.33  17.41  27.29   9.59  12.08  10.13  19.25  11.63   \n",
       "\n",
       "        MUL    CLO    BEL    MAL  months_num  \n",
       "0     10.83  12.58  18.50  15.04           1  \n",
       "1      9.79   9.67  17.54  13.83           1  \n",
       "2      8.50   7.67  12.75  12.71           1  \n",
       "3      5.83   5.88   5.46  10.88           1  \n",
       "4     10.92  10.34  12.92  11.83           1  \n",
       "5      7.17   7.50   8.12  13.17           1  \n",
       "6      7.58   7.96  13.96  13.79           1  \n",
       "7      9.25  10.46  16.62  16.46           1  \n",
       "8      7.79   9.08  13.04  15.37           1  \n",
       "9      8.54   9.00   8.58  11.83           1  \n",
       "10     5.71   8.67  20.71  16.92           1  \n",
       "11    10.37  14.58  15.59  14.09           1  \n",
       "12     2.33   3.37   5.25   7.04           1  \n",
       "13     0.50   2.67   7.17   5.17           1  \n",
       "14     4.75   5.63   7.54   6.75           1  \n",
       "15     8.21   7.33  13.04   9.04           1  \n",
       "16     8.71  11.38  15.92  16.08           1  \n",
       "17    14.67  16.71   8.79  17.96           1  \n",
       "18     1.92   2.71   6.87   7.83           1  \n",
       "19     3.13   3.37   6.50   6.79           1  \n",
       "20     7.04   7.87   6.75  12.42           1  \n",
       "21     6.34   7.50  10.88   9.92           1  \n",
       "22    10.75  13.17  14.79  20.58           1  \n",
       "23    15.37  15.12  23.09  25.25           1  \n",
       "24     7.12  12.04  14.04  17.50           1  \n",
       "25    16.08  19.08  20.50  25.25           1  \n",
       "26    18.66  19.08  26.08  27.63           1  \n",
       "27    11.92  11.04  20.30  18.12           1  \n",
       "28    21.46  19.95  27.71  23.38           1  \n",
       "29     9.92  11.96  18.88  19.25           1  \n",
       "...     ...    ...    ...    ...         ...  \n",
       "6544   9.21  11.21   9.59  19.95         216  \n",
       "6545  15.79  17.50  21.42  25.75         216  \n",
       "6546  10.79  10.21  17.88  17.96         216  \n",
       "6547  12.96  12.29  17.08  19.83         216  \n",
       "6548  21.00  20.58  21.67  34.46         216  \n",
       "6549  19.75  21.50  23.04  34.59         216  \n",
       "6550   6.63   6.75   9.54  17.33         216  \n",
       "6551   9.75  11.08  14.33  15.34         216  \n",
       "6552  16.21  16.17  26.08  21.92         216  \n",
       "6553  15.54  16.29  18.34  22.83         216  \n",
       "6554  11.42  10.50  11.25  13.50         216  \n",
       "6555  14.17  15.09  21.50  21.37         216  \n",
       "6556   7.96   3.37   5.21   6.92         216  \n",
       "6557   7.67   6.08   5.50  17.16         216  \n",
       "6558   6.13   5.96  10.92  18.08         216  \n",
       "6559   1.29   2.67   5.00   9.08         216  \n",
       "6560   4.42   5.88  19.79  19.79         216  \n",
       "6561   6.21   8.17   8.33  18.25         216  \n",
       "6562   2.13   4.71   3.21  10.29         216  \n",
       "6563   8.67   9.00  11.25  20.30         216  \n",
       "6564   5.09   5.04   9.92  11.00         216  \n",
       "6565  12.71  12.00  18.50  21.50         216  \n",
       "6566  10.83  11.71  11.92  31.71         216  \n",
       "6567   5.21   5.25   1.21  13.96         216  \n",
       "6568   3.04   3.08   4.79  11.96         216  \n",
       "6569  14.04  14.00  17.21  40.08         216  \n",
       "6570  15.25  18.05  21.79  41.46         216  \n",
       "6571  14.50  16.42  18.88  29.58         216  \n",
       "6572  12.46  12.12  14.67  28.79         216  \n",
       "6573  11.58  11.38  12.08  22.08         216  \n",
       "\n",
       "[6574 rows x 16 columns]"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# call data again but this time don't use parse_dates\n",
    "wind_data = pd.read_table(\"wind.data\", sep = \"\\s+\") \n",
    "\n",
    "# compute the month number for each day in the dataset, there are in total 216 months\n",
    "wind_data['months_num'] = (wind_data.iloc[:, 0] - 61) * 12 + wind_data.iloc[:, 1]\n",
    "\n",
    "wind_data\n",
    "\n",
    "# group the data according to the months_num and get the mean\n",
    "# monthly_data = wind_data.groupby(['months_num']).mean()\n",
    "\n",
    "# monthly_data.head()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Step 16. Calculate the min, max and mean windspeeds and standard deviations of the windspeeds across all locations for each week (assume that the first week starts on January 2 1961) for the first 52 weeks."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 433,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr>\n",
       "      <th></th>\n",
       "      <th colspan=\"4\" halign=\"left\">RPT</th>\n",
       "      <th colspan=\"4\" halign=\"left\">VAL</th>\n",
       "      <th colspan=\"2\" halign=\"left\">ROS</th>\n",
       "      <th>...</th>\n",
       "      <th colspan=\"2\" halign=\"left\">CLO</th>\n",
       "      <th colspan=\"4\" halign=\"left\">BEL</th>\n",
       "      <th colspan=\"4\" halign=\"left\">MAL</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th></th>\n",
       "      <th>min</th>\n",
       "      <th>max</th>\n",
       "      <th>mean</th>\n",
       "      <th>std</th>\n",
       "      <th>min</th>\n",
       "      <th>max</th>\n",
       "      <th>mean</th>\n",
       "      <th>std</th>\n",
       "      <th>min</th>\n",
       "      <th>max</th>\n",
       "      <th>...</th>\n",
       "      <th>mean</th>\n",
       "      <th>std</th>\n",
       "      <th>min</th>\n",
       "      <th>max</th>\n",
       "      <th>mean</th>\n",
       "      <th>std</th>\n",
       "      <th>min</th>\n",
       "      <th>max</th>\n",
       "      <th>mean</th>\n",
       "      <th>std</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Yr_Mo_Dy</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>1961-01-08</th>\n",
       "      <td>10.58</td>\n",
       "      <td>18.50</td>\n",
       "      <td>13.541429</td>\n",
       "      <td>2.631321</td>\n",
       "      <td>6.63</td>\n",
       "      <td>16.88</td>\n",
       "      <td>11.486667</td>\n",
       "      <td>3.949525</td>\n",
       "      <td>7.62</td>\n",
       "      <td>12.33</td>\n",
       "      <td>...</td>\n",
       "      <td>8.497143</td>\n",
       "      <td>1.704941</td>\n",
       "      <td>5.46</td>\n",
       "      <td>17.54</td>\n",
       "      <td>12.481429</td>\n",
       "      <td>4.349139</td>\n",
       "      <td>10.88</td>\n",
       "      <td>16.46</td>\n",
       "      <td>13.238571</td>\n",
       "      <td>1.773062</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1961-01-15</th>\n",
       "      <td>9.04</td>\n",
       "      <td>19.75</td>\n",
       "      <td>12.468571</td>\n",
       "      <td>3.555392</td>\n",
       "      <td>3.54</td>\n",
       "      <td>12.08</td>\n",
       "      <td>8.967143</td>\n",
       "      <td>3.148945</td>\n",
       "      <td>7.08</td>\n",
       "      <td>19.50</td>\n",
       "      <td>...</td>\n",
       "      <td>7.571429</td>\n",
       "      <td>4.084293</td>\n",
       "      <td>5.25</td>\n",
       "      <td>20.71</td>\n",
       "      <td>11.125714</td>\n",
       "      <td>5.552215</td>\n",
       "      <td>5.17</td>\n",
       "      <td>16.92</td>\n",
       "      <td>11.024286</td>\n",
       "      <td>4.692355</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1961-01-22</th>\n",
       "      <td>4.92</td>\n",
       "      <td>19.83</td>\n",
       "      <td>13.204286</td>\n",
       "      <td>5.337402</td>\n",
       "      <td>3.42</td>\n",
       "      <td>14.37</td>\n",
       "      <td>9.862857</td>\n",
       "      <td>3.837785</td>\n",
       "      <td>7.29</td>\n",
       "      <td>20.79</td>\n",
       "      <td>...</td>\n",
       "      <td>8.124286</td>\n",
       "      <td>4.783952</td>\n",
       "      <td>6.50</td>\n",
       "      <td>15.92</td>\n",
       "      <td>9.821429</td>\n",
       "      <td>3.626584</td>\n",
       "      <td>6.79</td>\n",
       "      <td>17.96</td>\n",
       "      <td>11.434286</td>\n",
       "      <td>4.237239</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1961-01-29</th>\n",
       "      <td>13.62</td>\n",
       "      <td>25.04</td>\n",
       "      <td>19.880000</td>\n",
       "      <td>4.619061</td>\n",
       "      <td>9.96</td>\n",
       "      <td>23.91</td>\n",
       "      <td>16.141429</td>\n",
       "      <td>5.170224</td>\n",
       "      <td>12.67</td>\n",
       "      <td>25.84</td>\n",
       "      <td>...</td>\n",
       "      <td>15.640000</td>\n",
       "      <td>3.713368</td>\n",
       "      <td>14.04</td>\n",
       "      <td>27.71</td>\n",
       "      <td>20.930000</td>\n",
       "      <td>5.210726</td>\n",
       "      <td>17.50</td>\n",
       "      <td>27.63</td>\n",
       "      <td>22.530000</td>\n",
       "      <td>3.874721</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1961-02-05</th>\n",
       "      <td>10.58</td>\n",
       "      <td>24.21</td>\n",
       "      <td>16.827143</td>\n",
       "      <td>5.251408</td>\n",
       "      <td>9.46</td>\n",
       "      <td>24.21</td>\n",
       "      <td>15.460000</td>\n",
       "      <td>5.187395</td>\n",
       "      <td>9.04</td>\n",
       "      <td>19.70</td>\n",
       "      <td>...</td>\n",
       "      <td>9.460000</td>\n",
       "      <td>2.839501</td>\n",
       "      <td>9.17</td>\n",
       "      <td>19.33</td>\n",
       "      <td>14.012857</td>\n",
       "      <td>4.210858</td>\n",
       "      <td>7.17</td>\n",
       "      <td>19.25</td>\n",
       "      <td>11.935714</td>\n",
       "      <td>4.336104</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1961-02-12</th>\n",
       "      <td>16.00</td>\n",
       "      <td>24.54</td>\n",
       "      <td>19.684286</td>\n",
       "      <td>3.587677</td>\n",
       "      <td>11.54</td>\n",
       "      <td>21.42</td>\n",
       "      <td>16.417143</td>\n",
       "      <td>3.608373</td>\n",
       "      <td>13.67</td>\n",
       "      <td>21.34</td>\n",
       "      <td>...</td>\n",
       "      <td>14.440000</td>\n",
       "      <td>1.746749</td>\n",
       "      <td>15.21</td>\n",
       "      <td>26.38</td>\n",
       "      <td>21.832857</td>\n",
       "      <td>4.063753</td>\n",
       "      <td>17.04</td>\n",
       "      <td>21.84</td>\n",
       "      <td>19.155714</td>\n",
       "      <td>1.828705</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1961-02-19</th>\n",
       "      <td>6.04</td>\n",
       "      <td>22.50</td>\n",
       "      <td>15.130000</td>\n",
       "      <td>5.064609</td>\n",
       "      <td>11.63</td>\n",
       "      <td>20.17</td>\n",
       "      <td>15.091429</td>\n",
       "      <td>3.575012</td>\n",
       "      <td>6.13</td>\n",
       "      <td>19.41</td>\n",
       "      <td>...</td>\n",
       "      <td>13.542857</td>\n",
       "      <td>2.531361</td>\n",
       "      <td>14.09</td>\n",
       "      <td>29.63</td>\n",
       "      <td>21.167143</td>\n",
       "      <td>5.910938</td>\n",
       "      <td>10.96</td>\n",
       "      <td>22.58</td>\n",
       "      <td>16.584286</td>\n",
       "      <td>4.685377</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1961-02-26</th>\n",
       "      <td>7.79</td>\n",
       "      <td>25.80</td>\n",
       "      <td>15.221429</td>\n",
       "      <td>7.020716</td>\n",
       "      <td>7.08</td>\n",
       "      <td>21.50</td>\n",
       "      <td>13.625714</td>\n",
       "      <td>5.147348</td>\n",
       "      <td>6.08</td>\n",
       "      <td>22.42</td>\n",
       "      <td>...</td>\n",
       "      <td>12.730000</td>\n",
       "      <td>4.920064</td>\n",
       "      <td>9.59</td>\n",
       "      <td>23.21</td>\n",
       "      <td>16.304286</td>\n",
       "      <td>5.091162</td>\n",
       "      <td>6.67</td>\n",
       "      <td>23.87</td>\n",
       "      <td>14.322857</td>\n",
       "      <td>6.182283</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1961-03-05</th>\n",
       "      <td>10.96</td>\n",
       "      <td>13.33</td>\n",
       "      <td>12.101429</td>\n",
       "      <td>0.997721</td>\n",
       "      <td>8.83</td>\n",
       "      <td>17.00</td>\n",
       "      <td>12.951429</td>\n",
       "      <td>2.851955</td>\n",
       "      <td>8.17</td>\n",
       "      <td>13.67</td>\n",
       "      <td>...</td>\n",
       "      <td>12.370000</td>\n",
       "      <td>1.593685</td>\n",
       "      <td>11.58</td>\n",
       "      <td>23.45</td>\n",
       "      <td>17.842857</td>\n",
       "      <td>4.332331</td>\n",
       "      <td>8.83</td>\n",
       "      <td>17.54</td>\n",
       "      <td>13.951667</td>\n",
       "      <td>3.021387</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1961-03-12</th>\n",
       "      <td>4.88</td>\n",
       "      <td>14.79</td>\n",
       "      <td>9.376667</td>\n",
       "      <td>3.732263</td>\n",
       "      <td>8.08</td>\n",
       "      <td>16.96</td>\n",
       "      <td>11.578571</td>\n",
       "      <td>3.230167</td>\n",
       "      <td>7.54</td>\n",
       "      <td>16.38</td>\n",
       "      <td>...</td>\n",
       "      <td>10.458571</td>\n",
       "      <td>3.655113</td>\n",
       "      <td>10.21</td>\n",
       "      <td>22.71</td>\n",
       "      <td>16.701429</td>\n",
       "      <td>4.358759</td>\n",
       "      <td>5.54</td>\n",
       "      <td>22.54</td>\n",
       "      <td>14.420000</td>\n",
       "      <td>5.769890</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>10 rows × 48 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "              RPT                                VAL                    \\\n",
       "              min    max       mean       std    min    max       mean   \n",
       "Yr_Mo_Dy                                                                 \n",
       "1961-01-08  10.58  18.50  13.541429  2.631321   6.63  16.88  11.486667   \n",
       "1961-01-15   9.04  19.75  12.468571  3.555392   3.54  12.08   8.967143   \n",
       "1961-01-22   4.92  19.83  13.204286  5.337402   3.42  14.37   9.862857   \n",
       "1961-01-29  13.62  25.04  19.880000  4.619061   9.96  23.91  16.141429   \n",
       "1961-02-05  10.58  24.21  16.827143  5.251408   9.46  24.21  15.460000   \n",
       "1961-02-12  16.00  24.54  19.684286  3.587677  11.54  21.42  16.417143   \n",
       "1961-02-19   6.04  22.50  15.130000  5.064609  11.63  20.17  15.091429   \n",
       "1961-02-26   7.79  25.80  15.221429  7.020716   7.08  21.50  13.625714   \n",
       "1961-03-05  10.96  13.33  12.101429  0.997721   8.83  17.00  12.951429   \n",
       "1961-03-12   4.88  14.79   9.376667  3.732263   8.08  16.96  11.578571   \n",
       "\n",
       "                        ROS           ...           CLO              BEL  \\\n",
       "                 std    min    max    ...          mean       std    min   \n",
       "Yr_Mo_Dy                              ...                                  \n",
       "1961-01-08  3.949525   7.62  12.33    ...      8.497143  1.704941   5.46   \n",
       "1961-01-15  3.148945   7.08  19.50    ...      7.571429  4.084293   5.25   \n",
       "1961-01-22  3.837785   7.29  20.79    ...      8.124286  4.783952   6.50   \n",
       "1961-01-29  5.170224  12.67  25.84    ...     15.640000  3.713368  14.04   \n",
       "1961-02-05  5.187395   9.04  19.70    ...      9.460000  2.839501   9.17   \n",
       "1961-02-12  3.608373  13.67  21.34    ...     14.440000  1.746749  15.21   \n",
       "1961-02-19  3.575012   6.13  19.41    ...     13.542857  2.531361  14.09   \n",
       "1961-02-26  5.147348   6.08  22.42    ...     12.730000  4.920064   9.59   \n",
       "1961-03-05  2.851955   8.17  13.67    ...     12.370000  1.593685  11.58   \n",
       "1961-03-12  3.230167   7.54  16.38    ...     10.458571  3.655113  10.21   \n",
       "\n",
       "                                          MAL                              \n",
       "              max       mean       std    min    max       mean       std  \n",
       "Yr_Mo_Dy                                                                   \n",
       "1961-01-08  17.54  12.481429  4.349139  10.88  16.46  13.238571  1.773062  \n",
       "1961-01-15  20.71  11.125714  5.552215   5.17  16.92  11.024286  4.692355  \n",
       "1961-01-22  15.92   9.821429  3.626584   6.79  17.96  11.434286  4.237239  \n",
       "1961-01-29  27.71  20.930000  5.210726  17.50  27.63  22.530000  3.874721  \n",
       "1961-02-05  19.33  14.012857  4.210858   7.17  19.25  11.935714  4.336104  \n",
       "1961-02-12  26.38  21.832857  4.063753  17.04  21.84  19.155714  1.828705  \n",
       "1961-02-19  29.63  21.167143  5.910938  10.96  22.58  16.584286  4.685377  \n",
       "1961-02-26  23.21  16.304286  5.091162   6.67  23.87  14.322857  6.182283  \n",
       "1961-03-05  23.45  17.842857  4.332331   8.83  17.54  13.951667  3.021387  \n",
       "1961-03-12  22.71  16.701429  4.358759   5.54  22.54  14.420000  5.769890  \n",
       "\n",
       "[10 rows x 48 columns]"
      ]
     },
     "execution_count": 433,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# resample data to 'W' week and use the functions\n",
    "weekly = data.resample('W').agg(['min','max','mean','std'])\n",
    "\n",
    "# slice it for the first 52 weeks and locations\n",
    "weekly.ix[1:53, \"RPT\":\"MAL\"].head(10)"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 2",
   "language": "python",
   "name": "python2"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 2
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython2",
   "version": "2.7.11"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 0
}
